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 / How do I get a user's ...
Power Apps
Suggested Answer

How do I get a user's oncall schedule from PagerDuty?

(1) ShareShare
ReportReport
Posted on by 330
I am calling a Power automate flow from my app, to retrieve on-call data using the PagerDuty api, for a chosen date range. This is what my HTTP call looks like
 
My flow basically looks like...
Then in my Respond to a Power App or Flow action, there is no array type so I am basically adding the output from my select. 
 
 
In my Power app, I have set the OnSelect of my end date dropdown to 
Set(
    varOnCallData,
    GetPagerDutyOnCallForUser.Run(
        varUserEmail,
        Text(DatePicker_Start.SelectedDate, "YYYY-MM-DDTHH:MM:SSZ"),
        Text(DatePicker_End.SelectedDate, "YYYY-MM-DDTHH:MM:SSZ")
    )
);
 
Then in my gallery, the items to 
varOnCallData.oncalls
My hope was with this, I would be able to reference the data retuned. However I am getting "Expected Table value".
 
Any idea on how to get this done?
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @Spawn10
     
    Yes, In the Respond to a Power App or Flow action, there isn’t an Array output type available. Because of that, you can’t directly return an array as a typed response.

    So instead, you pass the output of your Select action as the response value. This means you’re essentially returning the formatted array from Select, which Power Apps then receives (typically as JSON) and parses on the app side.

     
    Use ParseJSON() together with ForAll() to loop through the array and transform it into a collection. Once the collection is created, you can bind it to a Gallery control to display the data.

    For example - this code you need to put in powerapps: 
    ClearCollect(
        colPagerData,
        ForAll(
            Table(ParseJSON(YourFlowName.Run().OnCalls).body),
            {
                Column1: Text(Value.Column1ArrayResponse),
                Column2: Value(Value.Column1ArrayResponse)
            }
        )
    )
    
    
    /*
    You need to replace below things:
    YourFlowName - Replace with the name of your Power Automate flow.
    OnCalls - Replace with the property returned from the flow (for example, .result or similar).
    body - Replace with the actual response body that contains the array.
    Column1 / Column2 - Rename these to the column names you want in your collection.
    Column1ArrayResponse - Replace with the actual field name coming from the flow array.
    */
    

    Once the collection (colPagerData) is created, set your Gallery’s Items property to:

    Please follow the below blog for more detailed step-by-step guidance.

    https://www.matthewdevaney.com/power-apps-parsejson-function-get-collection-from-a-flow/

    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
  • Suggested answer
    Haque Profile Picture
    3,653 on at
     
    Let's analyse the error first. The error "Expected Table value" when we set our gallery's Items property to varOnCallData.oncalls,probably that means that varOnCallData.oncalls is not recognised as a table (a collection or array) by Power Apps.

    To me that happened because the flow should have returned a table/array but probably returned object or string. Or The variable varOnCallData itself is not yet populated or is a single object, not a record containing a table - either no data or single object.

    To place a first safe guard, let's check the returned output - this is bit of debugging, let's inspect  varOnCallData by adding a label with JSON(varOnCallData) to see the exact structure. This will give us a clue what's coming from the flow at least.

    Before checking the data, what you can do, do a safety check like this in the  gallery's Item:

    If(
        IsBlank(varOnCallData),
        [],
        varOnCallData.oncalls
    )
    

    In the very first place, it will ensure there is something or nothing.

    If you see data is there and it is JSON formatted (as we used JSON function or ParseJSON function), then you follow what @Kalathiya mentioned – it should work.

     

    By very best good luck if you see data, you can parse/convert it to JSON I see one more area we can improve, which is data format, as you have mentioned. In Power Apps, the date format string is case-sensitive for the Text function. Let's use "yyyy-MM-ddTHH:mm:ssZ" instead of "YYYY-MM-DDTHH:MM:SSZ". To be very specific:

    1. yyyy for year, MM for month, dd for day.
    2. HH for 24-hour format hours, mm for minutes, ss for seconds.
    3. The uppercase MM is month, lowercase mm is minutes

     

    Please let me know if this helps.

     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
     
  • Haque Profile Picture
    3,653 on at
     
    I was following up on this, did resolve the issue?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard