datguru
September 2, 2019, 7:12pm
1
Hi everyone, I can seem to add the following to an app connect api:
{ “current_USED_gte”: 1 }
This all loads up fine
However, when I try to put this into a server connect API it doesn’t seem to work is there a different way to create an array in server connect?
Any ideas what I am doing wrong thank you
Thanks
1 Like
datguru
September 2, 2019, 7:52pm
3
I don’t understand sorry @s.alpaslan I want to add in a custom Array / Object like I can in the app connect but I want to do this in server connect instead
I think you are using form in your page . If you are sending only “selection” parameters .you can use {{$_POST}} in query
datguru
September 2, 2019, 8:01pm
6
Oh no theres no user data coming in from a form this is a static array that I will be putting the data into. So I want to set the value of an array manually in the server connect
you can use “set value” option in serverconnect … (try please)
datguru
September 2, 2019, 8:08pm
8
I’ve tried that previously but it doesn’t work unfortunately
P.S Thank you for your help so far @s.alpaslan
will you use it in session?
George
September 3, 2019, 6:37am
12
You should use 3 double {, like this:
{{{ "current_USED_gte": 1 }}}
This is because the first two indicate expression to be evaluated and then the expression is an object with {} so it gets evaluated like this.
This was implemented in one of the recent Server Connect updates, so you can create dynamically object and arrays like this.
2 Likes
datguru
September 3, 2019, 7:26am
13
Brilliant thanks @George and also thanks @s.alpaslan . I’ll try this tonight and let you know how it goes :).
1 Like
Quy
February 24, 2021, 11:55pm
14
This is broken due to converting "
to "e;
. Probably related to Bad Formatting of JSON Data in API in ServerAction
Click on the bolt icon. Click Code.