Creating an array in an expression

I am trying to connect up to an API and in their documentation I need to create inside an http request an array like this:

    'plainPassword' => array(
        'password' => 'topSecret007',
        'confirm' => 'topSecret007',
    ),

how would i add this to a body parameter ?

So as I know js does not support associative arrays, so you could use js object:

Or you could make manipulate object to string to have this syntax

In case you have to send it as an actual array, then you would have to set an expression like this:
{{ {"plainPassword": [{"password": "topSecret007", "confirm": "topSecret007" }]} }}

Here an example workflow:

Thanks both for the advice. I have tried multiple variations however nothing is working for me yet.

From the mautic API this is what I am meant to be doing:

$data = array(
    'username' => 'apitest',
    'firstName' => 'John',
    'lastName' => 'Doe',
    'email' => 'john@doe.com',
    'plainPassword' => array(
        'password' => 'topSecret007',
        'confirm' => 'topSecret007',
    ),
    'role' => 1,
);

This is what i have tried to do so far

Try it like this: {{ {"password":"topSecret007", "confirm": "topSecret007" } }}

Thanks @RicardoE105 - that did the trick! Much appreciated.

Great that it worked. Have fun.

could i get a little bit more help… how would i pass a node value into this ?

{{ {"password":"{{$node["Set"].json["password"]}}", "confirm": "{{$node["Set"].json["password"]}}" } }}
when i view the result i get this

[invalid (Expression is not valid: Unexpected string)]", “confirm”: “mike1234” } }}

You would have to use:

{{ {"password": $node["Set"].json["password"], "confirm": $node["Set"].json["password"] } }}

Honestly this is the fastest forum i have ever worked on. This is the most incredible piece of technology developed changing the way less technical people can work.

Thank you so much for this amazing product and the great support!!

Thanks a lot! That is great to hear! We may not be able to promise you that it will be always that fast but we are definitely always doing our best!

Hello all, facing the same issue here. I am trying to get the skuId value from Merge 3 node and set it as an array. I have done as you guys stated above

{{ {$node[“Merge3”].json[“skuId”]} }}

but it gave me [ERROR: invalid syntax] error. Can you please help how can I get the value?

Hi @Beste_Celtek

You should probably open a new topic. But to answer the question. The expression has an extra { } around it, which seems odd to me. and is probably the reason why it is failing as it doesn’t seem like correct syntax indeed.

Also not sure if what you are doing is the best idea, but would be great to get a new topic with your issue and some more info on it so we can give a proper answer.

Thanks, I have removed the extra {} and added [ ] instead and it worked.