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 Apps / Convert json from Flow...
Power Apps
Answered

Convert json from Flow to collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a Power Automate Flow that returns the following json:

 

[{'Item':'Document.docx'},{'Item':'Document1.docx'}]

 

In PowerApps I am trying to convert it to a collection.

Set(SearchRslts, PowerApp.Run());

ClearCollect(TestColl, SearchRslts.searchlist);

 

I then look at the TestColl and it just has one element, instead of two.  Any idea on what is wrong here?

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,729 Most Valuable Professional on at

    Two potential issues I see.  

     

    1) are you using Respond to Power Apps or HTTP response action?  If you are using Respond to Power Apps that is the problem.  It cannot return a JSON array.  It can only return an object with multiple properties.  You need to use the HTTP Response action to return an array.

    2) You should be creating the collection directly from the response, not storing it in a variable first.

    ClearCollect(TestColl, PowerApp.Run());
  • KS-04101812-0 Profile Picture
    Microsoft Employee on at

    I switched my Flow to return an HTTP response and then call ClearCollect(TestColl, PowerApp.Run()) and that still did not work.  What does the http response need to be.  Does it need to be a json object or json array.  Currently, I am returning 

     

    [{'Item':'Document.docx'},{'Item':'Document1.docx'}]

     

    from the flow.  Is that correct?

  • Verified answer
    Pstork1 Profile Picture
    68,729 Most Valuable Professional on at

    It needs to be a JSON array and you need to have the appropriate JSON schema loaded in the HTTP response action.

  • KS-04101812-0 Profile Picture
    Microsoft Employee on at

    I got it working.  The issue was I needed to change the json string to use double quotes instead of single quotes.

  • DH-27020923-0 Profile Picture
    on at

    How did you do this?

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard