Can Bridge get data from Admin > Groups?

Cory_OWA
Cory_OWA ✭✭✭
edited 06/18/24 in API & Developers

Is there a known or suggested method or Bridge workflow I may use to record data from Admin Center > Groups to a Smartsheet? I want a workflow to look up the groups in our plan's Admin Center and replace the rows of a sheet and column on a daily recurrence.

Answers

  • Gia Thinh
    Gia Thinh ✭✭✭✭✭✭

    Hi Cory_OWA,

    I could not find a Workflow element in Bridge to get a Group list. However, using Smartsheet API is a good method to get the Group list in your account.


    Gia Thinh Technology - Smartsheet Solution Partner.

  • Brian_Richardson
    Brian_Richardson Overachievers Alumni

    @Cory_OWA Gia is correct in that there's not a pre-built Bridge step for working with Groups. However, you can use the Call API module to leverage the Smartsheet API as she's indicated above.

    For listing groups in a sheet, the Bridge workflow would look like:

    1. List the group by doing a Call API to https://api.smartsheet.com/2.0/groups . Note that you'll need to set this up in Call API with the https://api.smartsheet.com/2.0 piece of your URL in the Call API integration module as well as a Secret Header for Authentication: Bearer your token here. Then in the workflow the Make API Call step would have /groups as the endpoint
    2. Create a child workflow with a Search Sheet step. In Search Sheet, add a Row filter for ID = {{runtime.data.id}}. This will look in your sheet to see if the ID already exists.
    3. Now add a Is Empty conditional junction. For Value add the reference {{states.startstate.smartsheet.search_sheet.sheet.rows}}. Add states to both sides of the Junction where "success" means that no ID was found, and Failure means that the ID was found (the results aren't empty)
    4. Add a Add Rows step under the Success side of the junction. In Add Rows settings, define the columns that you want to add, for example ID and Group Name. Then, for the values for those columns use {{runtime.data.id}} and {{runtime.data.name}} as the references
    5. Go back to the first workflow and add a "Run Child Workflow" step. Point it at the workflow you created in step 2. In the Number of Runs option put the reference {{states.startstate.call_api.make_api_call.response.data}}
    6. Click Triggers in the first workflow and schedule it to run on the schedule that you want.

    This setup will run, read the list of groups, search your sheet to see if you already captured that group, and if not will add the group name to the list.

    Note that this doesn't sweep your sheet clean of groups that no longer exist. If you need that functionality you'll need a separate Bridge workflow to work this in reverse…read your sheet and then read the list of groups and then probably use a little Javascript to compare the two and produce a list of row IDs that don't match the group list, then finally Delete Row that list of row IDs.

    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN