So I currently have a custom attributes where I need to check parameters if not equals to the set attribute but I want the condition to be case insensitive. And it seems like using != operator doesn't work that way.
I have this on the Flow:
<Step> <Name>EntityError</Name><Condition>(verifyapikey.Verify-API-Key.attr != "All") and (verifyapikey.Verify-API-Key.attr != params.entity) </Condition> </Step>
Solved! Go to Solution.
You can use a JS policy before this step and then set a variable like "invalidAttr = true"; after validating your use case and use this variable check the condition in the next step.
Something like this:
const attribute = context.getVariable('verifyapikey.Verify-API-Key.attr') || ''; const invalidAttr = attribute.toLowerCase() !== "all" && attribute !== params.entity ? true : false; context.setVariable('invalidAttr', invalidAttr);
<Step> <Name>EntityError</Name> <Condition>invalidAttr</Condition> </Step>
You can use regular expression matching in conditions.
<Condition>NOT (verifyapikey.Verify-API-Key.attr ~~ "(?i)All") and (verifyapikey.Verify-API-Key.attr != params.entity) </Condition>
This expression : "(?i)All"
... is a regex that matches any form of "all" , case-insensitively.