Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powerapps : Pass a json Array to a Flow

Context

I'm currently working on a specific search engine frontend, based on Powerapps, which need to pass a string array to a service through a Power-Automate Flow, in order to specify a filter.

The Flow

The flow itself takes a JSON object as input (which will be transmitted to the backend service), which looks something like this :

{
    service: "string"
    types : ["A", "B", "C", ...]
}

But Powerapps do not allow to create arrays, according to multiple source I found. When I try to serialize my object trough the JSON() function, I end up with the following result:

{
    service: "string"
    types : [{"Value" : "A"}, {"Value" : "B"}, {"Value" : "C"}, ...]
}

I've tried the following ways (and some more but I don't remember them all) to generate the object, hopping for something working, but I'm now out of idea.

Collect(arrayTypes; ["A", "B", "C", ...])
ClearCollect(arrayTypes; ["A", "B", "C", ...])
Set(arrayTypes; ["A", "B", "C", ...])
Set(arrayTypes; JSON(["A", "B", "C", ...]))
Set(arrayTypes; JSON(["A", "B", "C", ...].Value))
JSON(ForAll(arrayTypes.Value; ThisRecord.Value))

I'm currently considering passing the array as a comma separated string, and then insert it as a new value inside the JSON, but this will require to change the Power-Automate flow quite substantially (we actually got multiple array to pass), and I would prefer not to change this part too much.

Does anyone know a way to generate a proper JSON array from a Powerapps Collection/Table/Variable ?

Similar questions on StackOverflow that I've found
Nested tables in Powerapps - remove “Value” column when parsing JSON (No answer)
How to passing Text Input value from Gallery Control as a json in Power Apps? (Answer did not change anything to the current output)

like image 687
Dremor Avatar asked Nov 19 '25 12:11

Dremor


1 Answers

With JSON function it works for me and in your Power automate ParseJSON tu use it enter image description here

like image 119
FredericDietrich Avatar answered Nov 21 '25 03:11

FredericDietrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!