cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ali_Nawaz
Helper III
Helper III

Parse null in the content property of Parse JSon action

Hi, 

 

I am creating a flow and I need a way around to be able to parse "null" in the content property of parse Json. 

I have a "Execute a SQL query" action whose result set I pass in the content of Parse Json action and then pass that result as a response to powerapps (Check screenshot)

Screenshot_1.png

 

Flow works fine untill the query doesn't return anything. Then the following issue appears (Check screenshot )

Screenshot_2.png

 

I do not want to put an IF Condition before Parse Json because doing so would be an overhead for me as the flow already takes some time to process final result and send it back to powerapps. 

 

 

Looking forward to usual helpful responses 🙂

 

Regards, 

Ali Nawaz

3 REPLIES 3
manuelstgomes
Super User II
Super User II

Hi @Ali_Nawaz 

 

You can define that the field can accept two types of data. String or null for example. To do that, please find the "content" in your JSON schema. You should have something like:

 

"symbol": {
	"type": "string"
}

 

change it to:

"symbol": {
	"type": [
		 "string",
		"null"
	]
}

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

@manuelstgomesI do not want some field/column to accept null.

I am looking for a workaround which permits me to have null in the "Content" section of Parse Json action.

manuelstgomes
Super User II
Super User II

Hi @Ali_Nawaz 

 

If you want null in the "Content" section of the Parse JSON, you need to indicate that you can allow that value in the schema (like I mentioned in the post above). If not, the Flow will fail because it will not pass the schema validation.

 

You also mention that you do want to accept nulls. The question is:

1. If you want to accept nulls, you need to include the "null" part in the schema that validates the JSON

2. If you don't want to accept nulls, you need to remove the null part so that the FLow will fail when there's a null in the JSON.

 

Makes sense?

 

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (11,043)