Hi,
I have a constant which contains array of text, I want to check if a given value is in the array subset of that constant.
For that I'm using-
contains(
{
cons!TA_CITY_LABEL[1],
cons!TA_CITY_LABEL[3],
cons!TA_CITY_LABEL[4],
cons!TA_CITY_LABEL[7]
.
and many more
},
local!label
)
I wonder if there is any solution to it as I have to write the name of constant again and again and I'm checking this multiple times on different datasets.
Discussion posts and replies are publicly visible
You can use it like cons!name[array of indices], this will save you much time.
contains( cons!TA_CITY_LABEL[{ 1, 3, 4, 7 }], local!label )
index(cons!TA_CITY_LABEL,{1,2,3,4},{})
Oh god! What type of hacks have you started writing, Sanchit?
Why? is there anything wrong in that?
Oh great! Thank you so much
Yes. AFAIK, Appian never officially said in their documentation that you can pass multiple values in the square brackets. This means that they might treat it as a bug and can fix this in any release and all the affected code will start breaking. Please use index() instead.
Oh no I should have done it myself, but what Sanchit suggested above is amazing. Thanks for the help
You scared the sh** out of me, I wish they don't it or else I'm fired.
Okay, but then I'm not responsible for the things Harshit said above