one_to_many mapping - repeat source value based on count of fieldPath… #2049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
one_to_many mapping - repeat source value based on count of fieldPath and do the target transformation. eg : for below mapping, where simple source field is mapped to array field, today there is a limitation, source field value gets copied to only first element of target array transformed data
In the example, selected fieldPath = "/data<>"
If i send source file which has 'namespace' field value = 'test'
and count of 'data' field is 2, then 'repeat action' gives source transformed data as = ["test", "test"]
this source transformed data is further passed to target action transformation execution
For above mapping, source.json is
{
"namespace": "iiot.schneider.mct.andon",
"version": "1.0.0",
"data": [
{
"Shift": 3,
"ANDON Type": "Facility"
},
{
"Shift": 100,
"ANDON Type": "Quality-IQC"
}
]
}
and transformed data is below, where 'iiot.schneider.mct.andon' repeated for all target array elements
{
"Site-Array" : "[{"ExternalReference":"Facility","ExternalReferenceSource":"iiot.schneider.mct.andon"},{"ExternalReference":"Quality-IQC"}]",
"ATLAS_DEFAULT_TARGET_DOC" : "[{"ExternalReference":"Facility","ExternalReferenceSource":"iiot.schneider.mct.andon"},{"ExternalReference":"Quality-IQC"}]"
}