Hi Amit Trivedi ,
Thankyou for using Microsoft Q&A platform and thanks for posting your question here.
As per my understanding you are trying to use if expression in ADF pipeline to check if value of a variable is equal to 0 or not. In case if it's equal to 0, then return the output value from first lookup activity else return the output value from second lookup activity.
First of all, the expression which you have shared doesn't have length property , however, in the error message , we can see the expression is supposed to return the length of the output array after evaluating the if condition. Could you please cross check that and remove length from the expression. Also, if possible kindly share the screenshot of your pipeline.
I would suggest you to create an additional variable of type 'array' and use a set variable activity before foreach and store the output array of 'if expression ' into that variable and then in the foreach point to that variable as item.
Hope it helps. Kindly accept the answer by clicking `Accept answer