Update List Collector via Flow

Austin_Brunet1
Tera Contributor

Hi Everyone!

 

I am trying to figure out how to update a list collector in a custom table via flow without clearing the value, and adding the new value.

 

Test Case:

When users onboard, they are assigned roles (i.e. boss, user, supervisor, janitor, etc.), which reference the Access Roles table (keying off of the role name [role]). After being approved for their role and all tasks to get that role's access, a sub-flow kicks off. The sub-flow creates/updates records in the Role Tracking table. It is to check the role that was granted against the roles that the user already has (Role(s) [role_s]), which is a list collector. If the user has the role, it does not add it, but if the user doesn't the Role(s) field should update (again a list collector field type) with the new role.

 

  1. I have tried to the input being a list (using the Access Roles table as the reference), but this clears the value, and adds the new.
  2. I have tried using a string field, then look up record and try and add the role to list collector that way. No luck.
  3. Since the [role] field in the Access Role table is a choice type, there is no sys_id associated to the roles to add by sys_id.

 

Any other ideas?

 

@Ahmmed Ali @Ankur Bawiskar @Ravi Chandra_K @Harsh Vardhan 

2 REPLIES 2

Ahmmed Ali
Mega Sage

Hello @Austin_Brunet1 

you can try either of below workaround:

 

1. You can use script in flow designer while updating the list collector field, this would be simple solution,

OR

2. You can create one custom action which will take the role and user details as input, then in action you can use script activity, query table and create/update record as needed and pass the result in output variables. Now you can call this action in your flow.

 

Thank you,

Ali

 

If I could help you with your Query then, please hit the Thumb Icon and mark my answer as Correct!!

Thank you,
Ali

1. How is the list collector updated? I have seen posts about using client scripts. Can you give more detail around how to actually update the list collector in a server script?