Set null as defaultValue in custom action | Community
Skip to main content
Level 2
December 26, 2022
Question

Set null as defaultValue in custom action

  • December 26, 2022
  • 0 replies
  • 670 views

We have custom action configured where we are passing certain fields. The requirement is to send the field as 'null' where we don't have the data. We used the below functionality of AJO to set the value as null but the problem is AJO does not send this field name itself in the REST call if the value is set to null.

 

#{ExperiencePlatform.ProfileFieldGroup.profile._tenant.gender, defaultValue: null}

 

If we don't send this field as 'null' from the custom action payload, the API fails with an error. How to set this value in the payload as 'null' so that the API request body will always have structure like the below in the example

 

For no value in AEP

{

"customerID": "123",

"gender": null

}

 

If AEP has value then

{

"customerID": "123",

"gender": "male"

}

 

Currently, for empty or null values in AEP, the custom action is sending the payload like below & which is failing due to certain limitations at the destination system which always requires field to be set as null.

{

"customerID": "123"

}

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.