and more in a single search tool across platforms. Read the announcement here. |
04/12/2022 01:18 PM
Hello All,
I wanted to check if we can create dynamic rule to have multiple attributes with any strings added ?
For example :
UPR-${user.location}-${user.customproperty1.substring(1,user.customproperty1.indexOf(||))}-${user.customproperty2.substring(1,user.customproperty2.indexOf(||))}
Like if I have 3 attributes and I have to make it dynamic rule with concat UPR- string .
Also I have to use substring from other 2 atributes as shown in above example.
Kindly help me with right syntax so that I use that as dynamic rule to trigger enterprise roles .
Thank you
Ankit Jain
Solved! Go to Solution.
04/12/2022 02:55 PM
Hi Ankit,
I'm assuming that you are generating the Role Name in your dynamic logic. Here's a simple example that will assign the Role Named based on the values of the user attribute.
e.g. If the role name is Role-CHI-White-Sox and the user attributes for the target audience that matches this role are as follows
User Location : CHI
User CP1 = White
User CP2 = Sox
You can have the following under Object in the Technical Rule : Role-${user?.location}-${user?.customproperty1}-${user?.customproperty2}
Regards,
Avinash Chhetri
04/12/2022 02:55 PM
04/12/2022 02:55 PM
Ankit,
You can try with something like this :
For user attributes:
User Location : CHI||904
User CP1 = White
User CP2 = Sox||critical
The following logic should evaluate to : Role-CHI-White-Sox
Role-${user.location.toString().substring(0,user.location.indexOf('||'))}-${user.customproperty1}-${user.customproperty2.toString().substring(0,user.customproperty2.indexOf('||'))}
Regards,
Avinash Chhetri
04/12/2022 02:55 PM
Hi Avinash,
Sorry for late response .
I have been trying the string you provided above, when I use that ,it kept searching
UPR-${user.orgunitid}-${user.customproperty50.toString().substring(0,user.customproperty50.indexOf('||'))}-${user.customproperty56.toString().substring(0,user.customproperty56.indexOf('||'))}
May be because it accepts number and not string ? I also tried removing toString() and tried, it got selected , but it didnt trigger the rule .
Please suggest .Thank you
Ankit
04/12/2022 02:55 PM
Ankit,
I'm able to use the logic you have posted just fine.
Regards,
Avinash Chhetri
04/12/2022 02:55 PM
I am able to get that selected...but rules are not triggering .
04/12/2022 02:55 PM
Please check the application logs to see if there are leads that will help to resolve your issue.
Regards,
Avinash Chhetri