cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gorilla_8
Memorable Member
Memorable Member

HTTP REQUEST - GET ITEM AND RETURN POWERAPPS

Hey guys, I need to GET a field named "CtrSAP" on a project site, but I never worked with this before.

 

Someone can help me out how I get the field and show a gallery on PowerApps, 

 

If you wanna know the app works on collection...

 

Here the flow I am trying to do...

 

http_notresposnse.png

 

And I don't know it the code on "URI" is correct: 

_api/ProjectData/Tarefas?select=CTrSAP

 

I need to get the field "CTrSAP" to put on a label in PowerApps...

 

Thanks for the help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Gorilla_8 ,

Could you please share a bit more about your scenario?

Do you want to get the "CtrSAP" field value of a specific item from your SP List using flow and then return it back to your app?

Or get the "CtrSAP" field values from all records in your SP List, and then return the "CtrSAP" field value collection back to your app?

 

If you wan to get the "CtrSAP" field value of a specific item from your SP List using flow and then return it back to your app, I think it is not necessary to add a "Send an HTTP request to SharePoint" action, instead, you should configure your flow as below:

5.JPG

Then within your canvas app, you should execute the following formula:

Set(
    returnedValue, 
    'FlowName'.Run("Type specific List Item ID here").department   // department represents the Output parameter specified in your "Respond to a PowerApp or flow" action
)

 

If you want to get "CtrSAP" field values from all records in your SP List, and then return the "CtrSAP" field value collection back to your app, I think there is something wrong with your flow's configuration. I have made a test on my side, please take a try with the following flow's configuration:

7.JPGWithin the "Send an HTTP request to SharePoint" action, Uri field set to following:

_api/web/lists('c548e6fb-4d82-4b26-81d4-1dc79415cfef')/items?$select=Title

on your side, you should type:

_api/web/lists('Your SP List Guid')/items?$select=CtrSAP

 

Within the "Response" action, Body field set to following:

body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']

"Response Body JSON Schema" field set to following:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Title": {
                "type": "string"
            }
        },
        "required": [
            "Title"
        ]
    }
}

On your side, you should type:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "CtrSAP": {
                "type": "string"
            }
        },
        "required": [
            "CtrSAP"
        ]
    }
}

Note: I assume that the "CtrSAP" field is Text type column in your SP List

Within your canvas app, configure it as below:

8.JPG

 

9.JPG

Note: For getting the List GUID value, you could go to the List Settings of your SP List, then the GUID value would be shown up as below:

6.JPG

 

More details about returning table value from a flow back to an app, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @Gorilla_8 ,

Could you please share a bit more about your scenario?

Do you want to get the "CtrSAP" field value of a specific item from your SP List using flow and then return it back to your app?

Or get the "CtrSAP" field values from all records in your SP List, and then return the "CtrSAP" field value collection back to your app?

 

If you wan to get the "CtrSAP" field value of a specific item from your SP List using flow and then return it back to your app, I think it is not necessary to add a "Send an HTTP request to SharePoint" action, instead, you should configure your flow as below:

5.JPG

Then within your canvas app, you should execute the following formula:

Set(
    returnedValue, 
    'FlowName'.Run("Type specific List Item ID here").department   // department represents the Output parameter specified in your "Respond to a PowerApp or flow" action
)

 

If you want to get "CtrSAP" field values from all records in your SP List, and then return the "CtrSAP" field value collection back to your app, I think there is something wrong with your flow's configuration. I have made a test on my side, please take a try with the following flow's configuration:

7.JPGWithin the "Send an HTTP request to SharePoint" action, Uri field set to following:

_api/web/lists('c548e6fb-4d82-4b26-81d4-1dc79415cfef')/items?$select=Title

on your side, you should type:

_api/web/lists('Your SP List Guid')/items?$select=CtrSAP

 

Within the "Response" action, Body field set to following:

body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']

"Response Body JSON Schema" field set to following:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "Title": {
                "type": "string"
            }
        },
        "required": [
            "Title"
        ]
    }
}

On your side, you should type:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "CtrSAP": {
                "type": "string"
            }
        },
        "required": [
            "CtrSAP"
        ]
    }
}

Note: I assume that the "CtrSAP" field is Text type column in your SP List

Within your canvas app, configure it as below:

8.JPG

 

9.JPG

Note: For getting the List GUID value, you could go to the List Settings of your SP List, then the GUID value would be shown up as below:

6.JPG

 

More details about returning table value from a flow back to an app, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft Thank you very much for the help! 

 

Yes, I wanna get the "CtrSAP" field values from all records in your SP List (PROJECT LIST), and then return the "CtrSAP" field value collection back to my gallery collection.

 

I try to make this code simple, but on my PowerApps didn't recognize the "FLOW"

 

See as below:

 

I make this code OnSelect

 

ClearCollect(CTRPSA_Collection;'Cópiade-GetTasksWithCustomFields'.Run())

 

powerapps_1.png

 

On the gallery ITEMS:

 

CTRPSA_Collection

 

the_collection_powerapps.png

 

But, on the flow, I get the same error, over and over:

 

first_piece_flow_run.png

second_piece_flow_run.png

 

He gets the code on-field CTrSAP, like this:

 

{
  "d": {
    "results": [
      {
        "__metadata": {
          "id": "https://minhaticloud.sharepoint.com/sites/PRIME/_api/ProjectData/Tarefas(IddeProjeto=guid'5a2ce245-bafc-e911-930c-204747fc83d9',IddeTarefa=guid'620a9e57-d306-ea11-8282-204747fc83d9')",
          "uri": "https://minhaticloud.sharepoint.com/sites/PRIME/_api/ProjectData/Tarefas(IddeProjeto=guid'5a2ce245-bafc-e911-930c-204747fc83d9',IddeTarefa=guid'620a9e57-d306-ea11-8282-204747fc83d9')",
          "type": "ReportingData.Tarefa"
        },
        "CTrSAP": "AE-07   "
      }....

 

The first result was: AE-07, but there are more I wanna show within the gallery, recognizing the ID's.

 

But, I appreciate your help so far! Thank you very much! @v-xida-msft 

 

 

 

 

 

Hi @Gorilla_8 ,

Have you added the flow connection into your canvas app?

 

Please make sure you have added the flow connection into your canvas app already. More details about firing a flow from an app, please check the following article or video:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/using-logic-flows

https://www.youtube.com/watch?v=1wl9AtxWdkg

 

Within the "Response" action, please make sure the Body field is set to following expression:

body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']

set the "Response Body JSON Schema" field to following JSON Schema:

{
    "type": "array",
    "items": {
        "type": "object",
        "properties": {
            "CTrSAP": {
                "type": "string"
            }
        },
        "required": [
            "CTrSAP"
        ]
    }
}

Note: Please type proper field name "CTrSAP" within above JSON Schema (under properties and required property). The field name within above JSON Schema is Case Sensitive, so please make sure type correct field name within above JSON Schema.

 

You could also consider check the following blog for returning table value back to canvas app:

https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/

 

Please consider check above blog step by step, then apply it to your scenario, then save your flow. Within your canvas app, remove the flow connection, then re-create a new flow connection in your app, check if the issue is solved.

 

If you still have issue with this scenario, I think a quick call in Teams would help your scenario better.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft Thanks for the help!

 

I get the error, I do everything right, but I just need to refresh the flow on PowerApps, and then he recognizes the field I wanna show.

 

Thank you so much for the help, also your time and your knowledge! 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages