Hi @Mike Kiser ,
I think, it would be vise versa like
@contains(variables('NoPension'), item().code)
not
@contains(item().code,variables('NoPension'))
:)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello again,
@Nasreen Akter @MartinJaffer-MSFT @HimanshuSinha-msft
I am using a @Contains()
@contains(item().code,variables('NoPension'))
In an IF Condition in my Pipeline
Variables('NoPension') is an array of values and I need to see if the job code (code) is in this array of values (job codes). If NOT, then I want it to fall under True. I haven't used variable arrays before.
I am getting the following error; I have worked on this for several hours and not sure how to set the expression to do this.
Thanks!
Mike Kiser
Hi @Mike Kiser ,
I think, it would be vise versa like
@contains(variables('NoPension'), item().code)
not
@contains(item().code,variables('NoPension'))
:)
Hey @Mike Kiser ,
Based on the error message it is clear that you cannot compare different data type variables.
So one way would be to use a for loop with the array variable as the input and for each iteration check whether the string value is matching to any value in iteration and set a flag variable in case if it matches.
Since in the code I see item.code it means that you are already using for loop and u cannot call for loop within for loop.
So you need to have a pipeline created for the comparison and call that pipeline within the for loop