How do I automatically add emails to a User Group from a form with automation?

Nicolas (Nic) Gonzalez
Nicolas (Nic) Gonzalez โœญโœญโœญ

I created a form that requires users to provide their email addresses in a Contact List field. This form feeds (source) into a Dynamic View, but I currently have to grant each user access to the view individually.

To streamline this, I set up a user group, making it easier to add users. However, I want to automate this process so that when users submit a request, they are automatically added to the user group in Smartsheet, and consequently, to the Dynamic View. Any suggestions?

Answers

  • Erin Horiuchi Green
    Erin Horiuchi Green โœญโœญโœญโœญโœญโœญ
    edited 02/07/25

    Hello @Nicolas (Nic) Gonzalez ,

    Your improvement of the Dynamic View to a User Group is the right way to go. Below is what I have done to increase the interoperability of the applications I have access to (Smartsheet API, Visual Studio Code).

    Phase 1
    1) Enable your API key.
    2) Create an Automation notification to yourself for new Contact record with just the email email address.
    3) Run the below Python code.

    Add User to a Group
    import smartsheet
    smartsheet_client = smartsheet.Smartsheet('YOUR API KEY') #wrap API key with apostrophes
    new_members = smartsheet_client.Groups.add_members(ย  INSERT GROUP ID, ย  ย  ย  # group_idย  [smartsheet.models.GroupMember({'email': 'INSERT EMAIL'})]) #wrap email with apostrophes

    Phase 2
    1) PowerAutomate grabs automated Smartsheet notification and run above code.
    2) PowerAutomate scheduled to run every x time period (minutes, hours, day, etc.)

    Erin Horiuchi Green, MBA, LSSYB, PSMI
    Process Manager
    Syneos Health

    Please kindly like โค๏ธ, upvote โฌ†๏ธ and/or mark โœ… any of my contributions that have provided value.

    Core App and Project Managment Certified ๐Ÿš€

  • Nicolas (Nic) Gonzalez
    Nicolas (Nic) Gonzalez โœญโœญโœญ

    Hi @Erin Horiuchi Green

    Thank you for your response! Unfortunately, I donโ€™t have access to the tools you used, and based on my knowledge of Smartsheet, Iโ€™m not sure where to start with this method. Iโ€™m hoping for a simpler solution that aligns with my limited understanding of Smartsheet functions.

  • Paul Newcome
    Paul Newcome Community Champion

    The only way to automatically add users to a group is through the API, the premium add-on Bridge, or some other similar third party app. There is no way to accomplish it within the core app or within Dynamic View.