RredCat
RredCat

Reputation: 5421

Power Automate: How to get response from form in key-value (field-name:field-value) format?

I have a simple workflow implemented in Power Automate. A user fills out a form, and it triggers my flow, where I extract a response and send it in an email.

I use following actions:

  1. trigger: "When a new response is submitted"
  2. action: "Get response details"
  3. action: "Create HTML table"
  4. action: send an email.

My issue is that on step 2, I get output something like the:

[
  {
    "responder": "[email protected]",
    "submitDate": "4/25/2019 3:48:26 PM",
    "r92de569b263d4dd2856237db53eae005": "Name",
    "r180d3b4446d8430d9bb5d2299153840d": "Surname",
    "rc81933a57345466b963c4a87e4255816": "45"
  }
]

All values don't have relevant keys. I could format an email without 3td step. But in this case, I have to format the email body manually, I have to add each value in the body, something like I did with Comments: screenshot

But, the form that triggers this flow is changeable and I don't want to edit the flow for each new field added/removed to the form. So, I want to convert all fields to html and put it in the email.

My expectation from the 2nd step is the following:

[
  {
    "responder": "[email protected]",
    "submitDate": "4/25/2019 3:48:26 PM",
    "First Name": "Name",
    "Second Name": "Surname",
    "Age": "45"
  }
]

How to achieve this?

Upvotes: 0

Views: 1852

Answers (1)

Unfortunately there is no default action to capture Question Titles. As You experienced, You can create dynamic tables with data itself but titles won't show up.

This one recommends usage of XPath to get titles but I am not sure about the solution: https://johnliu.net/blog/2017/11/foreach-property-in-microsoftflow-json-with-xpath-microblog

Upvotes: 0

Related Questions