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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Build a collection of ...
Power Apps
Answered

Build a collection of items returned from ms FLOW

(0) ShareShare
ReportReport
Posted on by 143

Hi,

 

I have a flow which should return a list of devices to powerapps. I want to organize them within a collection.

My powerapps button does the following, could somebody please advise how I could get this working?

ClearCollect(
 DeviceCollection,
 Table('DeviceRequest'.Run("Param1").result.value
 {
 Device: Device
 }
 )
)

 

Here is the flow for reference.

 

notepadapp_0-1707096293750.png


Output of "Output" is similar to the below:

{
 "statusCode": "200",
 "schema": {
 "type": "object",
 "properties": {
 "result": {
 "title": "Result",
 "x-ms-dynamically-added": true,
 "type": "string"
 }
 }
 },
 "body": {
 "result": "[{\"Device\":[\"MacBook Pro - HOSTNAME\",\"Latitude 7410 - HOSTNAME\"

 

Categories:
I have the same question (0)
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @notepadapp 

    You can try to use this code in Power Apps:

     

     

     ClearCollect(DeviceCollection,ForAll( Table( ParseJSON( 'DeviceRequest'.Run("Param1").result )) , {Device : Text(ThisRecord.Value.Device )} ) )

     

     

    For more information, you can refer to :
    ParseJSON function - Power Platform | Microsoft Learn

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • notepadapp Profile Picture
    143 on at

    That worked, though I believe the values aren't being presented correctly or are the correct type.
    When I do a dropdown/combobox of the collection I get this:

    notepadapp_0-1707098029883.png

     

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @notepadapp 

    Thanks for your quick response! Sorry , your Device is an array in your flow..

    I test it in my side , if it is an array , you can try to use this code :

     

    ClearCollect(datatest, Ungroup( ForAll( Table( ParseJSON('DeviceRequest'.Run("Param1").result )) , {Device : ForAll( Table(ThisRecord.Value.Device ) , {Device : Text(ThisRecord.Value)}) } ) ,"Device") )

     

     

    And if you want to get the Distinct Device , you can use this code :

     

    ClearCollect(datatest, Distinct( Ungroup( ForAll( Table( ParseJSON('DeviceRequest'.Run("Param1").result )) , {Device : ForAll( Table(ThisRecord.Value.Device ) , {Device : Text(ThisRecord.Value)}) } ) ,"Device") ,Device) )
    

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     

    Best Regards,

    Yueyun Zhang

  • notepadapp Profile Picture
    143 on at

    Thank you Distinct Device worked 🙂

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard