Array in server connect API vs App Connect

Hi everyone, I can seem to add the following to an app connect api:

{ “current_USED_gte”: 1 }

image

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?

image

Any ideas what I am doing wrong thank you :slight_smile:

Thanks

1 Like

{{$_POST}}

Did you try before ?

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

try

@datguru
try please

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)

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?

@datguru

try please

{{'testing'+':'+'test'}}

result

wrong syntax!

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

Brilliant thanks @George and also thanks @s.alpaslan. I’ll try this tonight and let you know how it goes :).

1 Like

This is broken due to converting " to &quote;. Probably related to Bad Formatting of JSON Data in API in ServerAction

Click on the bolt icon. Click Code.

12728