Concatenate strings and variables

abg

New member
Dear Developers,

Please point to documentation as to how a string which contains " signs can be concatenated with a variable in your Macrodroid software.

I am trying to pass json values via http request, and wish to pass some values stored in a variable as part of the JSON request, but the valiable ({some_var}) is being passed as a string "{some_var}".

Case:
JSON
{
"field": "{some_var}"
}

Output on the http request:
field = {some_var}

Expected result:
field = 1234

Any pointers would be highly appreciated

Thanks
ABG
 

Endercraft

Moderator (& bug finder :D)
Dear Developers,

Please point to documentation as to how a string which contains " signs can be concatenated with a variable in your Macrodroid software.

I am trying to pass json values via http request, and wish to pass some values stored in a variable as part of the JSON request, but the valiable ({some_var}) is being passed as a string "{some_var}".

Case:
JSON
{
"field": "{some_var}"
}

Output on the http request:
field = {some_var}

Expected result:
field = 1234

Any pointers would be highly appreciated

Thanks
ABG
It must be {lv=some_var}, not {some_var}.
 

abg

New member
Thanks for your suggestion, something changed but not sure what, my error code from the server changed from success 200 to 400 that is invalid format, is there a way to have debug logs and see what output is being passed onto http?

I tried both lv and gv, same error. I am using call_number variable
 

Endercraft

Moderator (& bug finder :D)
If it's a global variable use {v= instead of {lv=
Also if you click on the 3 dots next to the field you can see magic texts and select your variable there.
 

abg

New member
Tested still there is some error, is there a way to see the output?

The string now looks like this:-
{
"name": "{v=call_number}"
}

is there a way to see the output of this, this is breaking json.
 

abg

New member
UPDATE:-

I checked on the server side using tcpdump

The data is being passed as it is and nothing is being updated in the variable

From server logs:
{
"name": "{v=call_number}"
}
 

abg

New member
it is now working, without the use of lv or v or gv. Nothing is supposed to be used.

Working code
{
"name": "{call_number}"
}
 

Endercraft

Moderator (& bug finder :D)
it is now working, without the use of lv or v or gv. Nothing is supposed to be used.

Working code
{
"name": "{call_number}"
}
Oh yeah only variables you define yourself have lv= or v=
You can check the system log to see the output
 
Top