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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (47,641)