Pebble template returns null values in Destination SDK requestBody
We are configuring a destination in Adobe Experience Platform using Destination SDK server configuration. We are able to create the connection and send profiles to the destination, but the payload is resolving to null values even though the source attributes are populated.
We are using PEBBLE_V1 in the requestBody template and referencing nested profile attributes under personal_details, we are looking for guidance on whether there is any syntax issue in the template logic that could cause populated fields to resolve as null.
structure:
{
"templatingStrategy": "PEBBLE_V1",
"value": "{\n \"items\": [\n {% for profile in input.profiles %}\n {\n \"firstname\": {% if profile.personal_details.first_name is empty %}null{% else %}\"{{ profile.personal_details.first_name }}\"{% endif %},\n \"lastname\": {% if profile.personal_details.last_name is empty %}null{% else %}\"{{ profile.personal_details.last_name }}\"{% endif %},\n \"emailaddress\": {% if profile.personal_details.email_address is empty %}null{% else %}\"{{ profile.personal_details.email_address }}\"{% endif %}\n }{% if not loop.last %},{% endif %}\n {% endfor %}\n ]\n}"
}
Is there anything in the Pebble syntax or request body formatting that could cause values to render as null even when the mapped attributes are present?
Any suggestions would be appreciated.