In this article, we'll understand the basics of JSON and how we are going to implement it in Power Automate.
JSON (JavaScript Object Notation) is a lightweight data interchange format. It is simple for humans to read and write. It is simple for machines to parse and generate.
Example:
myJSON = '{"name":"John", "age": 31, "city":"New York"}'; 




"inputs": {
"variables": [....]
}Inside the array of "variables", we have another object.
"variables": [
{
"name": "JSON_OBJ",
"type": "object",
"value": {....}
}
]Array Filter Action goes through an array and returns a new array with the elements that pass the filtering condition. We are going to create a separate or filtered array in which has "country": "Canada".
Below is the JSON object we are going to use for the Array Filter action.
[
{"firstname":"Mike", "lastname":"Timber","age":"22","country":"Canada"},
{"firstname":"Sarah", "lastname":"Johns","age":"34","country":"USA"},
{"firstname":"James", "lastname":"Li","age":"23","country":"Cameron"},
{"firstname":"Donald", "lastname":"Shaw","age":"12","country":"Canada"},
{"firstname":"Nancy", "lastname":"Rowley","age":"33","country":"USA"},
{"firstname":"David", "lastname":"Smith","age":"23","country":"UK"}
]








Select is a control that transforms a JSON array from one format to another format.
For example, we have a JSON object format like below:
[
{"firstname":"Mike", "lastname":"Timber","age":"22","country":"Canada"},
{"firstname":"Sarah", "lastname":"Johns","age":"34","country":"USA"},
{"firstname":"James", "lastname":"Li","age":"23","country":"Cameron"},
{"firstname":"Donald", "lastname":"Shaw","age":"12","country":"Canada"},
{"firstname":"Nancy", "lastname":"Rowley","age":"33","country":"USA"},
{"firstname":"David", "lastname":"Smith","age":"23","country":"UK"}
]By using Select Action we can convert it to the below format:
[
{"Name": "Mike Timber", "Year_Born": 1999},
{"Name": "Sarah Johns","Year_Born": 1987},
{"Name": "James Li","Year_Born": 1998},
{"Name": "Donald Shaw","Year_Born": 2009},
{"Name": "Nancy Rowley","Year_Born": 1988},
{"Name": "David Smith","Year_Born": 1998}
]




concat(item()['firstname'], ' ', item()['lastname'])We add this expression to the Name property from Expression (Add dynamic content). Click on OK.
sub(2021, int(item()['age']))We add this expression to the Year_Born property from Expression (Add dynamic content). Click on OK.


JSON receives a string that has a JSON object and converts it into the parts that expose the properties of the JSON object.
For example, we have a string as a JSON object in which Parse JSON will disassemble the string into parts.
{"firstname":"David", "lastname":"Smith","age":"23","country":"UK"}









I am Sharvari Raut, having sound knowledge and experience in technical writing. Currently, pursuing my B.Tech in Computer Science and Engineering.