Power Automate Functions - JSON Function

Power Automate Functions - JSON Function

What is JSON function?

JSON Function is used to convert STRING value into JSON ARRAY[] and it performs different functions. It also converts XML string values into JSON.


Description:

In this guide, we will discuss how to use the JSON function in power automate. Let’s create a new flow. To create a new flow follow the following instructions:


Go to power Power Apps:

Power Automate Functions - JSON Function

Navigate to Flows:
Power Automate Functions - JSON Function

Click on the ‘New Flow’ button:
Power Automate Functions - JSON Function

After clicking new flow select ‘Instant Cloud flow’ form the dropdown:
Power Automate Functions - JSON Function


Finally set its name and select ‘manually’ as flow trigger point:
In the below screenshot we set the Name of flow and its trigger point which is ‘Manually trigger a flow. Finally, click on the create button to create a new flow. 
Power Automate Functions - JSON Function

First of all, add INITIALIZE VARIABLE ACTION :
To initialize a variable select initialize variable action from the actions set. Then set its properties the same as mentioned in the screenshot.
Power Automate Functions - JSON Function

Now add a COMPOSE ACTION to convert string variable into JSON
Power Automate Functions - JSON Function

Power Automate Functions - JSON Function
Code:
json(variables('Name'))

call this function in it action using expression editor

Output:
It will give output in an array
Power Automate Functions - JSON Function

Now add INITIALIZE VARIABLE second for XML:
Power Automate Functions - JSON Function
Now add a COMPMOSE ACTION  to convert string into json:
Code:
json(xml(variables('XML variable')))
call this function in it action using expression editor
Output:
It will return us an XML array in its output
Power Automate Functions - JSON Function


0 Comments

Thanks for commenting. Your comment will be live soon after approval.