Array to string Conversation

Hello @Teodor ,

I need to convert all values I post with form {{$ _POST}} to the following format. However, I have tried a few methods and could not reach the required result I ask for your help.

{{$_POST}}

{
    "locale": "tr",
    "conversationId": "123456789",
    "binNumber": "454671"
}

I have to convert to …

[locale=tr,conversationId=123456789,binNumber=454671]

do you have any idea ? or you can guide me ?

Create repeater with expression {{$_POST}}.

Create in the repeater steps a Set Value with name part and value {{$name + "=" + $value}}

Create after the repeater Set Value with value {{"[" + repeat1.join(",", "part") + "]"}}.

image

4 Likes

Hello @patrick,

Thank you for your solution but I get an error can you check it ?

did you use the join formatter in the last set value?

now working with this example but I dont know why it is not working if I use {{$name +’=’+ $value}}

Another way to do this, for those interested:

image

As everything you put into a variable is a String unless explicitly defined and Wappler will replace everything in the {{}} with their respective values.

This works for me. :smile:

3 Likes