Populate assignment group of catalog task based on RITM's requested for location

Harsha34
Tera Expert

Hello everyone,

@Ankur Bawiskar if you can please help on this.

 

I am trying to populate assignment group of catalog task based on RITM requested for location through flow designer.

 

The script is working fine with indexOf but this might not give correct results if required text e.g Noida or Chennai is at last or in middle position of location .

Below is the one that I used in script of assignment group of flow designer:

if (locations.indexOf("noida"))
 
Now, if requested for location is like 'abcdNoidaefg' then what should i use in place of indexOf , somewhat like contains or like?
Please suggest.
 
Regards,
Harsha
 
2 ACCEPTED SOLUTIONS

Its not complicated, it will work like contains search only.

Just use this

 

if (locations.toString().toLowerCase().indexOf("noida")>-1|| locations.toString().toLowerCase().indexOf("chennai")>-1 )

-Anurag

View solution in original post

Ohk great then I will try this and confirm you soon. Thanks a lot for your help, I’ll update you by tomorrow if it works or not.

Thanks,

Harsha

View solution in original post

25 REPLIES 25

Hi @Harsha34 ,
Once you get the requested for User,
Glide the user table and fetch the Location DisplayValue and store in a variable.

Now, GlideRecord the Group table and query nameLIKE(variable), (which gives the group contains variable),
You will get the record, return the sys_id of the record.

Hope this helps.


Another way is to create a custom field on the user table which references group table.
Add the group to the user.
Now, easily you can return requested_for.u_assignment_group;


Hope this helps.

Regards,
Najmuddin.

This is working through flow designer. LIKE is not working in the script

Hi @Harsha34 ,

It does work. Can you check the below screenshot.

NajmuddinMohd_0-1725287982060.png

 

Does it work in flow designer script?

Yes, I believe.