Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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'
like image 920
Santhosh Ramini Avatar asked Aug 16 '16 13:08

Santhosh Ramini


People also ask

How do I test my Azure logic app?

In the Azure portal, open your logic app workflow in the designer. On the designer, select the action where you want to return mock data so that the action details pane appears. After the action details pane opens to the right side, select Testing. On the Testing tab, select Enable Static Result (Preview).

What is difference between logic app and Azure function?

Compare Azure Functions and Azure Logic Apps Functions and Logic Apps are Azure services that enable serverless workloads. Azure Functions is a serverless compute service, whereas Azure Logic Apps is a serverless workflow integration platform. Both can create complex orchestrations.


1 Answers

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.

like image 200
Chris76786777 Avatar answered Sep 18 '22 05:09

Chris76786777