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 / How to Return Multiple...
Power Apps
Answered

How to Return Multiple Results from PowerAutomate to PowerApps

(0) ShareShare
ReportReport
Posted on by 473

My PowerAutomate Flow is triggered via a button, parsing in a parameter 'systemuserid'.

ClearCollect(BookableAreas, PowerAppV2_ListBookingAreas.Run(Self_Section_EmployeeName_Ddl.Selected.User));


PowerAutomate Flow then returns multiple results of 'Area'.hsl_name' based on the input parameter 'systemuserid'.

gymcode_0-1706160208061.png


Due to multiple results, I used 'Apply to each', and tried to output the values via 'Respond to a PowerApp or flow'.

gymcode_1-1706160305280.png

 

However, the following error occurred.

Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Flow save failed with code 'InvalidWorkflowRunAction' and message 'The workflow run action 'Respond_to_a_PowerApp_or_flow' has type 'Response' that could not be nested under an action of type 'foreach'.'."}}". Code: 0x80060467 InnerError: '.


May I know how can I output multiple values from PowerAutomate to PowerApps?

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

    Hi @gymcode ,

     

    Please try this

    vxiaochenmsft_0-1706160974747.png

     

    Best Regards,

    Wearsky

  • ruihaolrh Profile Picture
    473 on at

    Hi @v-xiaochen-msft , thank you for the suggestion.

    Quick question, I see that it's appended as a string. Will a dropdown control be able to populate each individual value from the appended string?

  • v-xiaochen-msft Profile Picture
    on at

    Hi @gymcode ,

     

    Sure, you can use split function in items property of dropdown.

    Sample:

    Split("a,b,c",",")

     

    Best Regards,

    Wearsky

  • ruihaolrh Profile Picture
    473 on at

    Hi @v-xiaochen-msft , thanks for the confirmation on the split function.

    However, the results returned from PowerAutomateFlow seems to be storing an entire object instead of just my specified 'hsl_name' value. (as per screenshots in previous post)

    Edit: Below are the values that I can specify in 'Apply to each' function from 'List rows' output:

    gymcode_0-1706163451363.png


    Thank you.

  • ruihaolrh Profile Picture
    473 on at

    Hi @v-xiaochen-msft , I am now attempting to utilize Appending to Array variable instead.

    gymcode_2-1706163758880.png


    In this case, below are the values that I can append to an Array, which I see there is an additional value of "Area - Unique identifier for entity instances'.

    gymcode_1-1706163741284.png

     

    However, at 'Respond to a PowerApp or flow', there is no 'Object' or 'Array' output option. 

    gymcode_3-1706163834539.png

     

    As I'm still unable to get a concatenated string value at this moment, may I know if Array or Object output is possible?


    Thank you.

  • v-xiaochen-msft Profile Picture
    on at

    Hi @gymcode ,

     

    Can you find the column name and value in the outputs from 'List rows' action?

     

    Best Regards,

    Wearsky

  • v-xiaochen-msft Profile Picture
    on at

    Hi @gymcode ,

     

    What output do you want flow to return?

    The value of a certain column?

     

    Best Regards,

    Wearsky

  • ruihaolrh Profile Picture
    473 on at

    Hi @v-xiaochen-msft , I want to return 1 value in the results. The value of that column is a Text field.

    Below is 1 out of 3 value output:

    "value": [
     {
     "@odata.type": "#Microsoft.Dynamics.CRM.hsl_area",
     "@odata.id": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/hsl_areas(417a9f63-a1b6-ee11-a568-000d3aa1b073)",
     "@odata.etag": "W/\"2450003\"",
     "@odata.editLink": "hsl_areas(417a9f63-a1b6-ee11-a568-000d3aa1b073)",
     "hsl_name": "Common Area",
     "hsl_areaid@odata.type": "#Guid",
     "hsl_areaid": "417a9f63-a1b6-ee11-a568-000d3aa1b073",
     "hsl_systemuser_hsl_area@odata.associationLink": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/hsl_areas(417a9f63-a1b6-ee11-a568-000d3aa1b073)/hsl_systemuser_hsl_area/$ref",
     "hsl_systemuser_hsl_area@odata.navigationLink": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/hsl_areas(417a9f63-a1b6-ee11-a568-000d3aa1b073)/hsl_systemuser_hsl_area",
     "hsl_systemuser_hsl_area@odata.type": "#Collection(Microsoft.Dynamics.CRM.systemuser)",
     "hsl_systemuser_hsl_area": [
     {
     "@odata.type": "#Microsoft.Dynamics.CRM.systemuser",
     "@odata.id": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/systemusers(96069027-eaad-ee11-a569-000d3aa1b073)",
     "@odata.etag": "W/\"2600179\"",
     "@odata.editLink": "systemusers(96069027-eaad-ee11-a569-000d3aa1b073)",
     "systemuserid@odata.type": "#Guid",
     "systemuserid": "96069027-eaad-ee11-a569-000d3aa1b073",
     "ownerid@odata.type": "#Guid",
     "ownerid": "96069027-eaad-ee11-a569-000d3aa1b073"
     },
     {
     "@odata.type": "#Microsoft.Dynamics.CRM.systemuser",
     "@odata.id": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/systemusers(a3f1bcec-86af-ee11-a569-000d3aa1b073)",
     "@odata.etag": "W/\"2440305\"",
     "@odata.editLink": "systemusers(a3f1bcec-86af-ee11-a569-000d3aa1b073)",
     "systemuserid@odata.type": "#Guid",
     "systemuserid": "a3f1bcec-86af-ee11-a569-000d3aa1b073",
     "ownerid@odata.type": "#Guid",
     "ownerid": "a3f1bcec-86af-ee11-a569-000d3aa1b073"
     },
     {
     "@odata.type": "#Microsoft.Dynamics.CRM.systemuser",
     "@odata.id": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/systemusers(015fde02-eaad-ee11-a569-000d3ac71097)",
     "@odata.etag": "W/\"2495600\"",
     "@odata.editLink": "systemusers(015fde02-eaad-ee11-a569-000d3ac71097)",
     "systemuserid@odata.type": "#Guid",
     "systemuserid": "015fde02-eaad-ee11-a569-000d3ac71097",
     "ownerid@odata.type": "#Guid",
     "ownerid": "015fde02-eaad-ee11-a569-000d3ac71097"
     },
     {
     "@odata.type": "#Microsoft.Dynamics.CRM.systemuser",
     "@odata.id": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/systemusers(dfc283ee-86af-ee11-a569-000d3ac71097)",
     "@odata.etag": "W/\"2609038\"",
     "@odata.editLink": "systemusers(dfc283ee-86af-ee11-a569-000d3ac71097)",
     "systemuserid@odata.type": "#Guid",
     "systemuserid": "dfc283ee-86af-ee11-a569-000d3ac71097",
     "ownerid@odata.type": "#Guid",
     "ownerid": "dfc283ee-86af-ee11-a569-000d3ac71097"
     },
     {
     "@odata.type": "#Microsoft.Dynamics.CRM.systemuser",
     "@odata.id": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/systemusers(eefa1f7e-439c-ee11-be37-000d3ac7f6d4)",
     "@odata.etag": "W/\"2606768\"",
     "@odata.editLink": "systemusers(eefa1f7e-439c-ee11-be37-000d3ac7f6d4)",
     "systemuserid@odata.type": "#Guid",
     "systemuserid": "eefa1f7e-439c-ee11-be37-000d3ac7f6d4",
     "ownerid@odata.type": "#Guid",
     "ownerid": "eefa1f7e-439c-ee11-be37-000d3ac7f6d4"
     }
     ],
     "hsl_systemuser_hsl_area@odata.nextLink": "https://deskreservationv2.crm5.dynamics.com/api/data/v9.1/hsl_areas(417a9f63-a1b6-ee11-a568-000d3aa1b073)/hsl_systemuser_hsl_area?$select=systemuserid"
     },
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @gymcode ,

     

    Do you want value of 'hsl_name' field?

    Please try this

    vxiaochenmsft_0-1706165180040.png

    items('Apply_to_each')?['hsl_name']
    vxiaochenmsft_1-1706165196534.png

     

     

    Best Regards,

    Wearsky

  • ruihaolrh Profile Picture
    473 on at

    Hi @v-xiaochen-msft , thank you for the expression. I managed to get the output text with delimiter.

    gymcode_0-1706167713741.png


    However, when the value is parsed to the Collection, and displayed in the dropdown control, numbers are displayed instead of each individual value.

    gymcode_1-1706167735197.png


    Button.OnSelect :

    ClearCollect(BookableAreas, PowerAppV2_ListBookingAreas.Run(Self_Section_EmployeeName_Ddl.Selected.User));


    DropdownControl.Items :

    BookableAreas


    DropdownControl.MultiValueDelimiter:

    ";"


    DropdownControl.Fields does not have any field options as well.

    gymcode_2-1706168624730.png

     

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 739 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 268

Last 30 days Overall leaderboard