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

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
-
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 ๐ -
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.
-
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.