The benefits of Parse JSON makes building a flow much easier and more convenient as it requires very little coding skill. And if you’re looking to integrate Microsoft systems, like Dynamics 365 or Business Central, knowing how to use the Parse JSON tool is extremely important. Plus, this skill can also be used with several other tools with a little more customization code, but knowing JSON makes the expansion easier.
However, there are times when using the Parse JSON tool isn’t always necessary.
When Parse JSON Shouldn’t be Used
Power Automate puts a limit on usage. As of today, every flow has a limit of 5,000 API requests. A closer look at the licensing information shows that this doesn’t mean that the flow can run 5,000 times because the system considers every flow action an API request. This means that if a flow has five actions, you’ll get 1,000 runs per day with the per user plan. On the other hand, the usage limit is increased to 15,000 API requests per day with the per flow plan.
For every requested HTTP action joined with a Parse JSON action, the number of API requests you’re using is doubled, which could be more than you actually need. Currently, Microsoft has been unclear about whether variables or data operations are included in the API request limit, but for the purpose of this article, it is assumed they are.
To see how to get a flow to run without the Parse JSON steps, use the expressions that are documented here or view the examples below.
Referencing a Field Using the Parse JSON Action
Without the Parse JSON action, we would need to use expressions to reference the fields located in the output of our HTTP request actions. To reference a single value from a single output, not an array, you can leverage the outputs () function. The name of the action goes between the parentheses and then the value path is specified between square brackets.
Action: Get Books API request https://www.googleapis.com/books/v1/volumes?q=isbn: ‘9780143126560’
Return body (simplified):
To get the total items: outputs(‘Get_Books’)?[‘totalItems’]
If the JSON goes a level deeper you simply separate the value references with a forward slash, e.g. [‘totalItems/field’].
When the data is returned as an array, an ‘apply to each’ action is needed, which changes the expressions. In the ‘apply to each’ action, you simply need to reference either the body of the request or the JSON field that is the array.
The example below illustrates this:
Action Get Books API request: https://www.googleapis.com/books/v1/volumes?q=isbn: ‘9780143126560’
Return body (simplified):
To get the field kind, you’ll first use the apply to each action: outputs(‘Get_Books’)?[‘items’]
Next, you’ll use this to return the kind for each item the array: items(‘Apply_to_each’)?[‘kind’]
The action name that goes inside the items function is the name of the apply to each step, which defaults to ‘apply to each’. When using these examples, don’t forget to replace the action name with your own.
Contact JourneyTEAM for Additional Information on JSON
If you have any questions regarding the information above or you want to learn more about using either Power Automate or JSON, contact a JourneyTEAM representative. We’ll show how to effectively use JSON in your Power Automate software and provide answers to any questions you might have. Contact us today!
JourneyTEAM was recently awarded Microsoft US Partner of the Year for Dynamics 365 Customer Engagement (Media & Communications) and the Microsoft Eagle Crystal trophy as a top 5 partner for Dynamics 365 Business Central software implementations. Our team has a proven track record with successful Microsoft technology implementations. We have experts ready to answer your questions about the latest Power BI updates and how it helps your ERP business activities. Contact JourneyTEAM today!