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

Community site session details

Session Id : af2U6bpZGWso1OeUyhALt8
Power Apps - Building Power Apps
Unanswered

Expecting string getting Object from API Call sent to Power Apps

Like (0) ShareShare
ReportReport
Posted on 31 Dec 2023 17:35:36 by 4

Good Day:

 

I am sending the following back to Power Apps after using the select function in Power Automate.  

RiskyBrass_0-1704044192080.png

 

I am getting an error message in Power Apps, after using the following formula to create a collection of the appointments to display in a vertical gallery:

 

ClearCollect(
    colAppointments,
    ForAll(
        Table(ParseJSON(GetPatientAppointments.Run(Appointment_Date.SelectedDate, PatientID.Text).result)),
        {
            appointmentid: Value(Value.appointmentid),
            appointmenttype: Value(Value.appointmenttype)
        }
    )
)
 
When I press the button it runs the flow successfully and returns the array of appointmentids and appointmenttypes.  However, Power Apps displays the "Expecting String but got Object".
 
How do I change the flow or power apps expression to visualize each appointment in the gallery/collection variable.  
 
Thanks
 
 
Categories:
  • Pstork1 Profile Picture
    67,165 Most Valuable Professional on 31 Dec 2023 at 18:18:34
    Re: Expecting string getting Object from API Call sent to Power Apps

    Ok, that all looks correct, but I think the casts you are doing in your Table are wrong.  You are returning string values, but trying to cast them to values, not strings.  You also aren't using ThisRecord. to identify the individual fields in the ForAll().  Try this code instead.

    ClearCollect(
     colAppointments,
     ForAll(
     Table(ParseJSON(GetPatientAppointments.Run(Appointment_Date.SelectedDate, PatientID.Text).result)),
     {
     appointmentid: Text(ThisRecord.Value.appointmentid),
     appointmenttype: Text(ThisRecord.Value.appointmenttype)
     }
     )
    )

     

  • RiskyBrass Profile Picture
    4 on 31 Dec 2023 at 17:46:34
    Re: Expecting string getting Object from API Call sent to Power Apps

    Hi Pstork1,

     

    Thanks for your reply.  This is coming together!

    RiskyBrass_0-1704044725360.png

    Given your suggestion, I will try to use the HTTP response action to send the data back to Power Apps, rather than using the Respond to Power Apps action?

     

    Thanks

  • Pstork1 Profile Picture
    67,165 Most Valuable Professional on 31 Dec 2023 at 17:39:57
    Re: Expecting string getting Object from API Call sent to Power Apps

    Can you show a screenshot of how you have configured the Respond to Power Apps action?  If you want to return an array of results to store in a table you need to use the HTTP response action. Respond to Power Apps can only send an object with specific simple properties, not an array of objects. If you are trying to use the new ParseJSON() function in Power Apps then the response needs to be a single object with a single text property.

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2