2024 Dec 17 8:25 AM - edited 2024 Dec 17 8:38 AM
I’m working on an integration in SAP CPI where I need to handle missing or null values in the mapping. Specifically, I want to ensure that when there is no value for a specific source field, the target JSON payload includes "value": "". (see attached picture for current mapping).
We are encountering the following error in the flow:
"Error occurred during custom_attributes processing. The responsibilities_employee attribute code doesn't have a value set. Enter the value and try again."
The current payload looks like this:
{
"attribute_code": "responsibilities_employee"
}
The requirement is that when there is no value for the attribute (e.g., responsibilities_employee), we need the output to include:
{
"attribute_code": "responsibilities_employee",
"value": ""
}
I have tried the following:
Here’s the simplified flow I’ve been building:
However, it’s still not working as expected, and when the source value is missing, the value tag is missing entirely in the output payload instead of defaulting to "".
How can adjust the mapping in order for it to work?
For the sake of clarity. When the field is populated it looks like this:
{
"attribute_code": "responsibilities_employee",
"value": "John Doe"
},
Request clarification before answering.
Please try with map by default
https://community.sap.com/t5/technology-q-a/map-with-default/qaq-p/5393237
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.