Sparse Json

  

I want to consume an external Web service from Oustsystems. The issue is that the json request has so many elements about 500. On the other hand the mandatory is only 10 elements.

How to achieve this - assigned only 10 in an action that call the consumed web service - with requirement the rest is also sent with their own default values - say the optional element with type text will has default value "", element with type numerik has value -999999999?

Thank you

So, all is sent, either mandatory and optional, but the optional is sent with default value (and without assig it in an action .. as the optional ones is so many, only yhe mandatory ones are assigned in an action).


Hi there Box, Verify the property "Send Default Value" in your struct.

Change for "No" and if this attribute is the default value not is sended.


Hi,

Charlos thank you.

But what i want is: the default values are sent without need to put assigments in an action.

Halo Box (IB?) How are you? I never tried this but from Carlos screenshot above seems there is a default value parameter that you can set?

Hi Box, Carlos is right, when setting 'send default values' to true, you only need to assign the mandatory values. All attributes of your structure that you do not explicitly assign a value will be part of the JSON with their default value.

Solution

Box wrote:

Hi,

Charlos thank you.

But what i want is: the default values are sent without need to put assigments in an action.

Hi there Box.

With this property set to "No", only values that have been previously filled will be sent.
If this field is set to "True", all fields in your structure will be sent.


Regards,

Carlos Alfradique

Solution