REST webservice  - Multi type JSON array

REST webservice  - Multi type JSON array


I'm using a REST service that receives as input parameter a JSON string like the following:

{ ObjectType: "Project", QueryType: "Get", Filters:{Projectname: "X", UpdateDate: [">", 23456765432]}}

So, it has a multi type array (not sure if this is the right name), something possible on Javascript but not on Outsystems as it's strongly typed. 

Did anyone already face this problem? If so, how did you solve?

The only possible solution I'm seing it's to pass a plain text and to create the JSON "by hand" ...

Just as an extra info, when I pass all this information to the Service studio it tries to solve the issue by using a Text List but that will produce something like [">", "23456765432"] and the webservice doesn't like that (i tried).

Thank you in advance,


I don't think there's a way for the platform to comply to that format. Like you said, you'llprobably have to create the JSON "by hand".
Hi Ricardo,

I would define it as Text List and then use the OnBeforeRequest callback to run a replace Regex and remove the " " from the numbers there.
That way you let the platform generate everything and just tweak it a bit, instead of having to write all the json.

Edit: did a quick test and this regex did the trick:


With double quotes escaped to use in Service Studio:
And replace by:

João Rosado
That's a very good idea Joao! 

Thank you for your help.
Just noticed that the regex will probably still need a bit of tweaking.
I wrote it based on your example, but I'm pretty sure the platform will write "UpdateDate":  with quotes.

So probably this one will work better:


João Rosado

Im fact that part is not a problem for the webservice, as it accepts the UpdateDate with quotes ("UpdateDate"), but thank you again for your help.
You were right João, the last tweak is need because, as you mentioned, the platform writes "UpdateDate":  with quotes.