Extend Object by Dynamically Adding columns based on delimited string
I have the following Input:
[
{
“Customer Super Key”: “CUST-XXX”,
“Customer Security Segment”: “BU00172;BU00173;BU00174;BU00176;BU00175”
}
]
I want to transform it to:
[
{
“Customer Super Key”: “CUST-XXX”,
“Customer Security Segment 1”: “BU00172”,
“Customer Security Segment 2”: “BU00173”,
“Customer Security Segment 3”: “BU00174”,
“Customer Security Segment 4”: “BU00175”,
“Customer Security Segment 5”: “BU00176”
}
]
I need to dynamically create the column names based on how many ; separated values I have in the string “Customer Security Segment” as that number can change. I know I will probably need to use Split and maybe Reduce and Extend but I’m having a tough time figuring it out. Can someone help me with this? Thank you!
Hi @Szymon,
I created a sample ultra pipeline with an error pipeline and you actually can’t have an open binary output view on the error pipeline, it has to be document output view. However, you can still manipulate the status code for the error message.
This is a simple error pipeline that outputs the error message if there are any errors from the main pipeline.
If you call this API and if the pipeline has an error, for example you’ll receive the following response based on the configuration of the mapper snap in the error pipeline:
You can notice that the status in the response corresponds to the status in the Mapper snap.