Hi All,
The number fields fax on the screen but in api as a text,If I do not enter anything on screen for fax number in api it is going as "0".
But Other fields ex phone number of type phone on screen and in api as a text ,If we do not enter any thing in phone number on screen ,The filed does not go in request to api,
Then why the fax number is going as "0"-Ideally want to skip the field in request if empty
Please suggest
You are now putting in that api input the boolean result of a condition (converted into text automatically by OutSystems.
It should be something like
If(Party.Faxnumber = 0 , "", Party.FaxNumber)
this, in combination with 'Send Default' = NO will only send the faxnumber if it is different from 0
Hey @Preeti zade,
Please check your API structure and set the "Send Default Value" attribute to "No" in the Advanced section of the API structure.
This ensures that the attribute will not be sent in the request when its value is empty.Also, before sending the request, add a check for the Fax Number field. If the Fax Number is 0, empty (""), or null, do not map/send the attribute in the request payload.
Hi @Sheikh Mohd Fahad
I have checked ,The send default value is NO already
and the fax is Number field on the screen not to enter text value and in api the field is Text.
while sending to api,this is also added,
But request goes as below,
"fax_number":"True"
If I dont add above condition,then request goes as
"fax_number":"0"
Thank you Dorine,Its working.
But did not get as for other phone type variables no need to set any of these conditions and they are going as blank as expected.
Regards
You should study the data types and their properties. Experiment a little. You will learn a lot.
You set :
send default value = No
and this fields is not mandatory
so when api call, if the field null, api auto remove this key-value