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 / Power Automate Respons...
Power Apps
Suggested Answer

Power Automate Response action result back to PowerApps

(1) ShareShare
ReportReport
Posted on by 475
Hi All,
 
Hope you're doing good.
 
I created a powerapp that calls a workflow which will get the metadata from a specific number of documents in a sharepoint library and ...should...return this information to a collection.
 
Workflow is created and seems to be working since i see in my "Response" action the correct result .... all my items metadata as a table.
 
 
Problem seems to be when i get back to my PowerApp. collection is created but only contains the titles of the columns, no data...and i really don't understand what i'm missing.
 
 
Would someone have an idea what's wrong with my thing ?
 
Thanks a lot in advance
 
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    Can you show the schema you are using in the Response action?  It could be failing because of the null values you are trying to pass.  Usually we adjust the schema to allow for null values or a data type, but that won't work for the Response action in Power Apps.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Kadd Profile Picture
    475 on at
    Hello @Pstork1,
     
    Thanks for your answer.
     
    I didn't put a schema in the Response action cause i get an error ...
     
     
    but it should be something like this : 
     
    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "NomDoc": {
                    "type""string"
                },
                "ID": {
                    "type""integer"
                },
                "NomProjet": {},
                "Confidentialite": {
                    "type""string"
                },
                "EtatDoc": {
                    "type""string"
                },
                "Typologie": {}
            },
            "required": [
                "NomDoc",
                "ID",
                "NomProjet",
                "Confidentialite",
                "EtatDoc",
                "Typologie"
            ]
        }
    }
     
    I tried it also removing the required part so it doesn't take the null values into account but the error is the same.
     
    Thanks a lot
  • Suggested answer
    Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    A valid schema is required or the Response action won't return the array to load into the collection.  But as I mentioned it doesn't let you handle null values in the schema.  My suggestion would be to run the array through a Data Select action to either remove the properties with null values or use Coalesce to replace the null values in those properties with some default value.  From the screenshot it looks like that only applies to the NomProject column.  Then use the output of the Data Select in the Response action and generate a Schema based on that output.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Kadd Profile Picture
    475 on at
     
    that's what i tried to do at first it didn't work and the problem is i want to collect only 10 documents (in my example from 2 to 10...but i only have 4 in my library).
     
    So i added this "do until" loop with a counter and add 1 for each loop. In this case i can't use the select since i need only a specific number of items. If i open my loop i have this ...
     
     
    The first compose adds 1 to the current ID, then i get the properties, i parse and append the result to an array at each loop (then i increment) and outside the loop i get the content of my appended variable into the Compose2 and set the ouputs to "Response".
     
    so in this case i cannot use the select ....
     
     
  • Kadd Profile Picture
    475 on at
     
    so i adapted 
     
     
    The conditions are :
     
    if( empty(item()?['NomProjet']),'x',item()?['NomProjet'])
    if(empty(item()?['EtatDoc/Value']),'x',item()?['EtatDoc/Value'])
    if(empty(item()?['Typologie/Value']),'x',item()?['Typologie/Value'])
     
    Now schema is 
     
    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "NomDoc": {
                    "type""string"
                },
                "ID": {
                    "type""integer"
                },
                "NomProjet": {
                    "type""string"
                },
                "Confidentialite": {
                    "type""string"
                },
                "EtatDoc": {
                    "type""string"
                },
                "Typologie": {
                    "type""string"
                }
            },
            "required": [
                "NomDoc",
                "ID",
                "NomProjet",
                "Confidentialite",
                "EtatDoc",
                "Typologie"
            ]
        }
    }
     
    but the error is still the same
     
     
    hmm...
     
     
  • Kadd Profile Picture
    475 on at
    Ah ! it works !!
     
    ok so i'm not really sure what happened but i recreated the workflow from scratch and had an error saying about the asynchronous functionnality that i should enable....so i did. and when i refreshed the workflow in the app i got the results on my collection....
     
    so much time spent on this, i should have recreated it a long time ago.
     
    bon ok...it works :-)
  • Pstork1 Profile Picture
    69,556 Most Valuable Professional on at
    I wasn't suggesting using a condition.  Its better to use a Coalesce.  Like this
     
    coalesce(item()?['NomProjet']),'x')
     
    If NomProjet is null then it will use x otherwise it will use NomProjet.
     
    But I'm glad you got it working.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     

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