The CreatorCon Call for Content is officially open! Get started here.

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.

4 REPLIES 4

E555
Tera Guru

custom Action returned a comma-separated string of sys_user sys_ids.
I want to update the User field (glide_list) in the user_criteria table with this string, but it doesn’t work.

How can I correctly update a glide_list field from a Flow Action output (string)?

E555_0-1760530666450.png

 

@E555 

the flow is unable to determine the GlideRecord and hence the error.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@E555 

you need to create Input of type Records.User

then it will allow you to pass input

AnkurBawiskar_0-1760530549569.png

AnkurBawiskar_1-1760530704499.png

1 question -> why you need Custom Action when you can directly use Lookup on User criteria record and update the user list field with FieldA value as you already have the values.

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

M Iftikhar
Giga Sage

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.

 

 

 

Thanks & Regards,
Muhammad Iftikhar

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