08-15-2023 11:28 PM - last edited on 08-23-2023 10:55 AM by dmiller
Hi Team,
I'm pulling data from the source system which have "n" columns, I wanted to count the number of columns that I'm getting from the Source System. So that to map them with the respective Target System.
Please help me out this, Thanks in advance.
Solved! Go to Solution.
08-17-2023 01:07 AM
Hi @Manzoor ,
You can use the following expression to replace the NULL values with blank in the entity object, assuming it is a flat object.
$entity.mapValues(val => val == null ? "" : val)
This will simply iterate over each value in the entity object, and check if the value is null, if it is, it will return an empty string otherwise it will return the original value.
08-16-2023 12:35 AM - edited 08-16-2023 12:36 AM
Hi @Manzoor ,
You can try the $.keys().length expression in the mapper snap. This will give you length of array that will contain all headers from the source.
BR.
Ivica
08-16-2023 01:11 AM
Hi @Manzoor ,
Do you mind sharing more details about this? What is the source system, what is the target system? Any data samples? What do you mean by "n" columns, not sure if you are referring to the keys in the input data or if the source system is a database, then you are referring to the table columns presumably?
@ivicakoteski has already proposed a solution that will count the keys in the input document, let us know if that's what you are looking for.
08-16-2023 04:02 AM
Source System: Workday Prism
Target System: SAP Concur
Pulling Data from WDPrism via web service and pushing in to SAP Concur. While pulling data I'm getting few fields "Status", "Header', "Entity", "_debug".
In " entity " I have the reqiured data. In Which there are 137 fields that I need to Map and transform in to excel table.
Mapping and transformation in to excel is done. But columns having NULL value should be replaced by Blank value.
Can u help me out this. Bcz among 137 fields or say as excel columns I have almost 70+ NULL values in the in each record.
Thanks
Manzoor.
08-17-2023 01:07 AM
Hi @Manzoor ,
You can use the following expression to replace the NULL values with blank in the entity object, assuming it is a flat object.
$entity.mapValues(val => val == null ? "" : val)
This will simply iterate over each value in the entity object, and check if the value is null, if it is, it will return an empty string otherwise it will return the original value.