Help to exclude records found in a flow stage stored in list collectors

Biddaum
Tera Guru

Yesterday I asked for some help in getting the correct values out of a list collector variable I had in a catalog item and it was very helpfully solved thanks to @Swapna Abburi:

Flow help to update a user record

 

I would have thought I could just simply reuse the values found in that process, but rather than using "is one of" there would be an option for "is not one of" however there isn't.

 

So what I'd appreciate some help with is how to make my flow update all user records except those found previously (or that are listed in the list collector variable called "u_admin_users "

 

So my flow has the following:

1. Get flow variables

2. Look up Records where sys_ID is one of u_admin_users

3. For each item in 2.

    4. Update user record

 

So ultimately what I want to do now is something to the effect:

1. Look up Records where sys_ID is NOT one of u_admin_users

2. For each item in 1.

    3. Update user record

 

Advice / ideas?

2 ACCEPTED SOLUTIONS

James Chun
Kilo Patron

Hi @Biddaum,

 

You can use a script within the Look Up User Records like the following:

JamesChun_0-1748300500177.png

Note that you would have to replace the 'u_admin_users' with your variable.

 

Cheers

View solution in original post

@Biddaum 

return "sys_idNOT IN"+fd_data.trigger.request_item.variables.u_admin_users+"^active=true^sys_idNOT IN"+fd_data.trigger.request_item.variables.another_variable_name;

View solution in original post

12 REPLIES 12

James Chun
Kilo Patron

Hi @Biddaum,

 

You can use a script within the Look Up User Records like the following:

JamesChun_0-1748300500177.png

Note that you would have to replace the 'u_admin_users' with your variable.

 

Cheers

@James Chun 

Thank you for that, it does work as I asked and I will mark you as having provided the solution, thank you.

 

I do have another extension to that if you are able to help please?

If I wanted to add extra fields to the 'isNOT' part and wanted to only do the active users are you able to advise?

 

So something like

return "sys_idNOT IN" + u_admin_users and "sys_idNOT IN" + u_other_users and active=true; 

@Biddaum 

return "sys_idNOT IN"+fd_data.trigger.request_item.variables.u_admin_users+"^active=true^sys_idNOT IN"+fd_data.trigger.request_item.variables.another_variable_name;

@Swapna Abburi 

I get an error "Non existent table"