When you’re working with data, not only do you need it quickly, but you also need it in a readable format, especially when you’re working with your CRM system. JSON (JavaScript Object Notation) is one way you can get data faster and in a more readable format with little to no coding experience.
JSON is a lightweight data-interchange format that is very readable and easy to create. This format is what allows an API to communicate with various systems, like Microsoft Dynamics 365 CRM and Dynamics 365 Business Central systems. When you Parse JSON, you’re interpreting that data with the specific language you’re currently using. An example of Parse JSON in use is when you take the raw JSON output data from Power Automate and transform it into values. The values can then be used as content in a dynamic flow.
There are many benefits to using the Parse JSOn action. In addition to making the flow easier and more convenient, it requires little coding experience. You can also use your JSON knowledge to help you integrate various Microsoft Systems like Dynamics 365 Business Central or Dynamics 365 Customer Engagement, Sales, Marketing, Field Service, Supply Chain Management, Human Resources and Customer Service. Finally, the objects you create in JSON match other code objects so if you’re looking to expand in other systems, this knowledge can help make it easier.
However, there are some limitations to using Parse JSON and certain situations when you wouldn’t want to use it.
Situations that Don’t Call for Parse JSON
If you’re using JSON within Power Automate, it’s important to be aware that the system has a usage limit. Currently, Power Automate has a limit of 5,000 API requests. When reviewing the licensing information of the system, it specifies that this doesn’t mean that the JSON flow can run 5,000 times because the system considers every flow as an API request. Rather, every flow has five actions which produces 1,000 runs per day on the per user plan. With the per flow plan, that limit is increased to 15,000 API requests every day.
Every time you request an HTTP action along with a Parse JSON action, you’re doubling the number of API requests and actually create more than you need. As of today, Microsoft has not specified about whether JSON variables or data operations are also included in the API request limit. However, for the purposes of this article, we will assume that they are.
How to Reference a Field Using the Parse JSON Action
If you’re not using the Parse JSON action and you want to reference a field, you would need to use expressions to reference a field located in the output of your HTTP request actions. If you want to refer to a single value from one output rather than an array, you’d have to use the outputs () function. You’d put the name of the action between these parentheses. The value path is specified between square brackets.
For example:
Syntax: outputs(Action_Name’)?[‘field’]
Action: Get Books API request https://www.googleapis.com/books/v1/volumes?q=isbn: ‘9780143126560’
Return body (simplified):
{
"kind": "books#volumes",
"totalItems": 1536
}
If you want the total number of items, you’d use this format: outputs(‘Get_Books’)?[‘totalItems’]
JSON can also go a level deeper by simply separating the value references with a forward slash, e.g. [‘totalItems/field’].
To get data as an array, you need to use the ‘apply to each’ action, which changes the format of the data. With this action, you just need to reference either the JSON field that is the array and the body of the request. Here’s an example:
Action Get Books API request: https://www.googleapis.com/books/v1/volumes?q=isbn: ‘9780143126560’
Return body (simplified):
{
"kind": "books#volumes",
"totalItems": 1536,
"items": [
{
"kind": "books#volume",
"id": "ebNDDwAAQBAJ"
},
{
"kind": "books#volume",
"id": "WXcHwzaUd4MC”
} ]
}
Finally, if you want to get the field kind, you’ll want to first use the ‘apply to each’ action: outputs(‘Get_Books’)?[‘items’]. Next, you’ll want to use this to return the specific kind for each item in the array: items(‘Apply_to_each’)?[‘kind’]. The specific name that goes inside the items function is the name of the ‘apply to each’ step.
Remember to replace the action name with your own if you’re using these examples in your own system.
Whether you have questions about the information we’ve provided or want to learn more about the benefits of using JSON or Power Automate, contact JourneyTEAM. We’ll provide all the answers to any of your questions. Get in touch with a representative today!
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.