How to do a 'null' check in 'if' condition action of Azure Logic App

Santhosh Ramini picture Santhosh Ramini · Aug 16, 2016 · Viewed 22.7k times · Source

I've created a logic app which contains some trigger, an 'http' connector and then an 'If' condition activity. The 'http' connector returns a 'json' result say jsonObj.

I'm able to check condition as @equal(body('HTTP')['jsonObj'].someProperty,'someValue') but not able to do a null check on that someProperty value.

Below are some ways I tried which are not working.

@equal(body('HTTP')['jsonObj'].someProperty, null) --Unable to save
@equal(body('HTTP')['jsonObj']?.someProperty,'null') --Comparing with string value 'null'

Answer

Chris76786777 picture Chris76786777 · Jul 7, 2017

You can now do:

 @equals(triggerBody()['jsonObj']?['someProperty'], null)

It's valid and can be saved but if you try to switch to Basic mode you'll get an error. Can still save though.