4

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)

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.