Hello i am at a loss here. I have a webhook that posts the body below shown below. I am trying to get the Id/values of the "Questions" object array. The issue is its a dynamic array. Normally i would just do a string variable and do an expression of something like a parse of questions and then on the variable i would do output('Parse')?[0]?['Value']. But not all the questions in the questions object array are sent every time. Plus the order is dynamic. Any idea how i can select a questions object by Id name vs by the numbered order? Thanks for your time.
{ "User": { "UserEmail": "admin@companyadmin.com", "UserFirstName": "Company", "UserLastName": "Admin", "UserMobile": null, "UserPhone": null, "UserPsaId": 0, "UserOfficeId": "", "UserIsAdmin": true, "UserIsPriority": false }, "Company": { "CompanyName": "test company", "CompanyId": 55555555, "CompanyTenantId": "123456-7895-1258778785-a074-1a2d2e5e79w7" }, "Ticket": { "TicketId": 0, "TicketSubject": "test - test - Test", "TicketDescription": "test test", "TicketEstimatedTime": 0, "CheckList": "\n", "Script": "\r\n", "Questions": [ { "Id": "firstName", "Label": "New Employees First Name", "Value": "test" }, { "Id": "lastName", "Label": "New Employees Last Name", "Value": "test" }, { "Id": "startDate", "Label": "Start Date", "Value": "2021-6-16" }, { "Id": "employeeSupervisor", "Label": "Employee Supervisor", "Value": "teste" }, { "Id": "location", "Label": "Location", "Value": "USA" }, { "Id": "employeeRole", "Label": "Employee Role", "Value": "Paralegal" }, { "Id": "jobTitle", "Label": "Job Title", "Value": "test" } ] }, "Feedback": { "FeedbackRating": 0, "FeedbackSentiment": 0, "FeedbackComment": "", "FeedbackPhone": "" }, "Routing": { "RoutingBoard": "", "RoutingStatus": "", "RoutingType": "", "RoutingSubType": "", "RoutingItem": "", "RoutingPriority": "", "RoutingSource": "", "RoutingIsNeedsApproval": false }, "Agent": { "AgentId": 0, "AgentFirstName": "", "AgentLastName": "", "AgentEmail": "" } }
Hi @Anonymous
You could use a select action and repurpose the id as a key with a label and value postfix. This will return a nested array but as the key value pairs should be unique at this point you can unnest them.
The result would look like follows:
You can then unnest with a series of expressions:
json(replace(join(body('Select'),','),'},{',','))
The output of which allows you to call the new object key names - for example firstname_label.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien
P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉
stampcoin
59
Michael E. Gernaey
47
Super User 2025 Season 1
rzaneti
29
Super User 2025 Season 1