How to update a glide_list field with multiple users from Look Up Records

E555
Tera Guru

Hello Community

I’m trying to build a Flow like this:

  1. Look Up Records from table TableA

  2. Get all values from the reference field FieldA (which refers to sys_user) in those records

  3. Update a record in user_criteria, setting the User field (glide_list) with all those users

I created a custom Action between the Look Up step and the Update step.
However, Flow Designer doesn’t allow me to pass the Look Up Records “records” array into an Action input of type Array.Object.
If I change the input type to String, I can pass multiple sys_ids as text, but I’m not sure how to handle this correctly.

I want to update the User field with all users from the Look Up Records result.
What’s the best or simplest way to do this in Flow Designer?

Thank you.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @E555,

To address your requirement, follow these steps in flow designer for a smooth implementation:

 

  • Create a Flow Variable:

    • Create a Flow variable, say "Criteria Users" and set its type to String. This will store the list of user IDs you intend to update in the User Criteria record.

      MIftikhar_0-1760533772797.png
  • Look Up Records Action:

    • Add a Look Up Records action for Table A (e.g., Incident). Apply a condition to filter records where Field A (e.g., Resolved by) is not empty.

      MIftikhar_1-1760533796200.png
  • Set Flow Variable using Script:

    • After the Look Up Records action, add a Set Flow Variable flow logic to populate the "Criteria Users" variable with the user IDs. Use the following script in the flow logic:

    var userList = "";
    var records = fd_data._1__look_up_records.records; // Adjust this for the correct Look Up Records result reference
    while (records.next()) {
    if (records.resolved_by && !userList.includes(records.resolved_by)) {
    userList += records.resolved_by + ",";
    }
    }
    return userList;
    This script loops through the resolved_by field in the records returned by the Look Up action, checking for unique users, and concatenates their sys_ids into a string (separated by commas).
    MIftikhar_2-1760533821512.png
  • Update Record Action:

    • Add an Update Record action to update the User Criteria table.

    • In the Fields section, set the Users field (which is of type glide_list) to the flow variable "Criteria Users". This field will now be populated with the list of user sys_ids.

      MIftikhar_3-1760533843865.png

Here is the successful execution:

MIftikhar_4-1760533906698.png
MIftikhar_5-1760533944225.png

If my response helped, please mark it as the accepted solution so others can benefit as well.

 

 

 

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @E555,

To address your requirement, follow these steps in flow designer for a smooth implementation:

 

  • Create a Flow Variable:

    • Create a Flow variable, say "Criteria Users" and set its type to String. This will store the list of user IDs you intend to update in the User Criteria record.

      MIftikhar_0-1760533772797.png
  • Look Up Records Action:

    • Add a Look Up Records action for Table A (e.g., Incident). Apply a condition to filter records where Field A (e.g., Resolved by) is not empty.

      MIftikhar_1-1760533796200.png
  • Set Flow Variable using Script:

    • After the Look Up Records action, add a Set Flow Variable flow logic to populate the "Criteria Users" variable with the user IDs. Use the following script in the flow logic:

    var userList = "";
    var records = fd_data._1__look_up_records.records; // Adjust this for the correct Look Up Records result reference
    while (records.next()) {
    if (records.resolved_by && !userList.includes(records.resolved_by)) {
    userList += records.resolved_by + ",";
    }
    }
    return userList;
    This script loops through the resolved_by field in the records returned by the Look Up action, checking for unique users, and concatenates their sys_ids into a string (separated by commas).
    MIftikhar_2-1760533821512.png
  • Update Record Action:

    • Add an Update Record action to update the User Criteria table.

    • In the Fields section, set the Users field (which is of type glide_list) to the flow variable "Criteria Users". This field will now be populated with the list of user sys_ids.

      MIftikhar_3-1760533843865.png

Here is the successful execution:

MIftikhar_4-1760533906698.png
MIftikhar_5-1760533944225.png

If my response helped, please mark it as the accepted solution so others can benefit as well.