web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Converting Object to a...
Power Automate
Unanswered

Converting Object to array so I can iterate over

(0) ShareShare
ReportReport
Posted on by 16

Hello, 

 

I have been trying several approaches for this but so far I haven't been able to find a working solution, the object is as follows:

 

{
"responder": "email@email.pt",
"submitDate": "8/3/2021 4:20:00 PM",
"ra7992b65ed8447a4a1876f5208aee8bc": "Session1",
"r87015f835f094985908684447fcc9533": "Session2",
"r480746f9f54640be8c76d998e1892e02": "Session3",
"r99d5fa99223b453f804a51b95ffa2c09": "Session4"
}

 

 

What I am trying to do is just convert this into an array without the responder or the submitDate, any ideas / tips would be appreciated!

 

Edit 1 (For future references): My idea was to make a power autoamte that is resuable to any MS form (that has a specific template) without having to hard-code convert the json answers into an Array.

 

Thanks in advance!

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    Can you just manually type what output you are looking to create please?

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    It looks like you are processing MS Forms data. The response data will be available to you as dynamic content.

    As @Paulie78 you can manually create the array. For example:

    ekarim2020_0-1628018650329.png

    ekarim2020_3-1628018985220.png

    ekarim2020_2-1628018834694.png

    Ellis

  • v-bofeng-msft Profile Picture
    on at

    Hi @Gexudo :

    I've made a test for your reference:

    vbofengmsft_1-1628216322740.png

    The Result:

    vbofengmsft_0-1628216227244.png

    Best Regards,

    Bof

  • Gexudo Profile Picture
    16 on at

    Hi everyone, thank you for the great replies and suggestions!

     

    However they are all a bit hard coded, my idea is to transform every answer of a specific forms template that we use into an array, without having to "hard-code" reference them in the array. The idea is to make this as easy to replicate to use with different forms which have the same template. And in doing so without the "hard-code" references, minimal change when replicating the flow would be needed.

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    You can do it like this:

    2021-08-06_10-01-08.png

    The output generated is:

    [
     "Session1",
     "Session2",
     "Session3",
     "Session4"
    ]

    The expression in Compose 2 is:

    xpath(xml(json(concat('{ "values": ', removeproperty(removeProperty(outputs('Compose'), 'responder'), 'submitDate'), '}'))), '/values/*/text()')

    Blog: tachytelic.net

    YouTube: https://www.youtube.com/c/PaulieM/videos

    If I answered your question, please accept it as a solution 😘

  • Gexudo Profile Picture
    16 on at

    Exactly what I was looking for! Thank you very much!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard