How can I get a specific value from JSON? I need to get the Answer of the Question: (Client Company Name *) I can get this output from previous steps.
[
{
"Answer": "IT Department",
"IsRequired": true,
"Question": "Branch/Department *",
"QuestionID": "3fe54329-3741-4759-a514-c78b15adf2a2"
},
{
"Answer": "Flash Sdn Bhd",
"IsRequired": true,
"Question": "Client Company Name *",
"QuestionID": "87ab759a-4232-4b6c-b47e-d3e5f8c42d44"
},
{
"Answer": "Testing Name",
"IsRequired": true,
"Question": "Client Contact Name *",
"QuestionID": "8d9ba61d-a6d3-4ae7-b8a4-cd0cb627f984"
},
{
"Answer": "zxc@gmail.com",
"IsRequired": true,
"Question": "Client Contact Email *",
"QuestionID": "4c146358-755e-4412-807c-289201774f96"
},
{
"Answer": "0112323234",
"IsRequired": true,
"Question": "Client Phone Number *",
"QuestionID": "c8e3675e-236c-4035-a8b2-05f9b8fd677f"
},
{
"Answer": "Position1",
"Question": "Client Contact Position",
"QuestionID": "de90d75a-7edd-4d49-8312-5d740d62a713"
},
{
"Answer": "1",
"AnswerOptions": [
"1",
"2",
"3"
],
"IsRequired": true,
"Question": "Accounting Software",
"QuestionID": "955a7e06-f3ab-4157-8ab5-a9c2674d1417",
"SelectedOptions": [
0
]
},
{
"Answer": "test",
"IsRequired": true,
"Question": "Client Enquiry / Remark *",
"QuestionID": "21a0d915-1143-4bf2-a638-e4207305a805"
}
]
Filter the array and get the 'Answer' property of the first element in the result array:
Filterm array
item()['Question']
Compose 2
first(body('Filter_array'))['Answer']