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,
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:
Best regards,
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,
User | Count |
---|---|
195 | |
123 | |
86 | |
48 | |
40 |
User | Count |
---|---|
281 | |
165 | |
139 | |
80 | |
76 |