cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ToniSans
Frequent Visitor

Powerapps on Custom API .NET

Hi folks!

 

I'm currently developing a custom API (RESTful .NET) that is working on powerapps.

I've no problem with the GETs or simple parameters like string or integer, but when I'm working on the POST I need to work with an entire collection, and I can't find the right type of variable to work with.

 

How can I represent a collection? A buffer?

 

Thank you,

 

3 REPLIES 3
v-xida-msft
Community Support
Community Support

HI @ToniSans ,

Could you please share a bit more about your scenario?

Do you want to send a POST request to your custom REST API along with a whole collection?

Further, which schema do you specified within the request body of the POST action in your custom conector?

 

Based on the needs that you mentioned, I assume that you specified a Object JSON Schema as the Request Body of the POST action in your custom connector, is it true?

 

If you want to send a POST request to your custom REST API along with a whole collection once time, I afraid that there is no way to achieve your needs in PowerApps currently. As an alternative solution, I think the ForAll function could achieve your needs.

 

On your side, please consider take a try with the following formula:

 

// Send POST requests based on the amount of WholeCollection records
ForAll(
       WholeCollection,
       'CustomConnector'.PostActionName({
                                          argument1: WholeCollection[@Column1],
                                          argument2: WholeCollection[@Column2],
                                          argument3: WholeCollection[@Column3],
                                          ...
                                        })
)

 

Note: The Column1, Column2, Column3, ... represents the columns from your WholeCollection.

 

More details about the ForAll function, please check the following article:

ForAll function

 

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.

Thanks for your answer Kris.

 

Unfortunately when I use a ForAll I make multiple request and I need it all at once.

 

Kind regards,

Hi @ToniSans ,

If the Request Body part you specified within the POST action in your custom connector is a Object, I afraid that there is no way to achieve your needs in PowerApps currently.

 

Currently, within PowerApps, the Request Body of the POST action in a custom connector could only allowed to provide a JSON Object value rather than a Table value.

So if you want to send a POST Request to your REST API along with a whole collection (Table value), I afraid that there is no way to achieve your needs.

 

If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,962)