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

Will it check for Noida or Chennai in lower case only ? Most of the locations are with initial letter in bold.

I have converted it to lower case we we should be good. 

-Anurag

We cannot modify any of the location names or any other foundation data.

So if we would have used contains or like something like this then the case sensitive concern would have gone.

Am I right?

This will work like contains query and case is also managed.

You can try it and let me know if it doesn't work.

 

Also I see you have marked your won response as correct, was that by mistake?

 

-Anurag

Yes, apologies it was by mistake 🙁but I hope this would work. I’ll let you know soon. 
Thanks,

Harsha