karh
January 24, 2023, 4:05pm
1
I need an object like this:
{
"email@email.com": {"ref_id":"999"}
}
Where the email and the ref_id values are variables.
So I have successfully created this object with this set value:
{{
{email@email.com:{ref_id:999999}}
}}
But my issues come when trying to place my variables:
This doesn’t work:
it simply makes “to_email” a string:
I feel like this is much harder than it should be. Hopefully I’m missing something.
Please help
karh
January 24, 2023, 9:12pm
3
@JonL I have a feeling this would be an easy RunJS one-liner? Any chance you can work your magic while Patrick finds time to make it easy for the peasants?
HeikoK
January 24, 2023, 9:25pm
4
Not at my computer, but couldn’t a simple group step do the job for the nesting?
bpj
January 25, 2023, 7:05am
5
You should be able to wrap in double quotes:
{
"{{to_email}}":{"ref_id":"{{referenceid_variable}}"}
}
Seems counter intuitive, especially when dealing with numbers, but it does work…
karh
January 26, 2023, 11:54am
7
Sadly not because there’s no data binder for the group name.
bpj:
You should be able to wrap in double quotes:
{
"{{to_email}}":{"ref_id":"{{referenceid_variable}}"}
}
Seems counter intuitive, especially when dealing with numbers, but it does work…
Thanks, I’m getting a bit closer, but its behaviour is very weird.
Right now this is what I put:
{
"{{to_email}}":{"ref_id":"{{ref_id_var}}"}
}
And this is the result:
The wappler UI does recognise them as blue variables:
JonL
January 27, 2023, 7:41pm
8
return { [to_email] : {"ref_id":ref_id} }
JonL
January 28, 2023, 12:20pm
9
LMAO just realized I pasted the wrong gif
That one was meant for a whatsapp group
Anyway, it can stay as it’s even funnier than the one I meant to paste.
1 Like
HeikoK
January 28, 2023, 12:41pm
10
1 Like
JonL
January 28, 2023, 3:55pm
11
You will find a lot of those around the forum. Sometimes I wonder how I am not banned yet
3 Likes
JonL
January 28, 2023, 5:45pm
13
There is only one plausible explanation. I’m the second account of @Teodor
3 Likes
karh
January 30, 2023, 1:24pm
14
Hahaha I deserved the gif.
After asking it I tried and realised this is very very basic.
So I’ll take Jesse’s loving words in exchange for wasting a few minutes of your time.
Appreciate it though…!