question

ewinkiser avatar image
0 Votes"
ewinkiser asked ewinkiser commented

ADF IF Activity Expression Question?

@nasreen-akter @MartinJaffer-MSFT @KranthiPakala-MSFT

For an IF Activity I have @equals(item().isFullTime,true) for the Expression. It doesn't seem to be working.

Do I need to use @equals(item().isFullTime, 'true') (with single apostrophe)? In the JSON we have

isFullTime":false or isFullTime":true

Thanks!
Mike

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShaikMaheer-MSFT avatar image
1 Vote"
ShaikMaheer-MSFT answered ewinkiser commented

Hi @ewinkiser

Thank you for posting your query.

If your json return values in Boolean that means as true or false then it will work in equals function.

In below example, My Lookup activity getting "isFullTime" property value in Boolean and I am using that property in IF activity with equals() function to compare with true. Its working fine for me. Kindly check below steps of implementation

Step1: Lookup activity getting data from SQL table
106550-lookupactivity.gif
Step2: Passing Value array from lookup activity to ForEach activity
106631-foreachactivity.gif
Step3: If Activity Inside ForEach Loop
106517-ifactivity.gif
Step4: If we observe execution. My pipeline is executing Activity which is inside True of IF condition. Hence, its shows that if your property value has Booleans such as true or false then you can use directly below expression to compare.
@equals(item().isFullTime,true)
106580-pipelineexecution.gif

Hope this will help. Please let us know if any further queries. Thank you


  • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

  • Want a reminder to come back and check responses? Here is how to subscribe to a email-notifications


lookupactivity.gif (1.2 MiB)
foreachactivity.gif (166.7 KiB)
ifactivity.gif (628.5 KiB)
pipelineexecution.gif (486.1 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks!! Great detailed explanation and simulations!! It worked the first time!

Mike Kiser

0 Votes 0 ·

Hi @ewinkiser ,

Glad to know that it worked for you. Happy to help. Thank you

1 Vote 1 ·

JHi @ShaikMaheer-MSFT

The True and False are nvarchar's in the DB Table. How can I handle that case?

Thanks
IMike

0 Votes 0 ·