Code sample for looping by creating new instance of the object in DTL

Hi,

 

I am trying to use data transformation (DTL) to map a JSON to SDA. My elements in the source JSON is not one to one with SDA object. That means I have to add code to loop through these objects in order to complete the mapping. Can someone send me a sample that can look to create that? I am not very comfortable with scripting language used in Health Share. Appreciate your help.

 

Regards

Joseph

Answers

Maybe I don't fully understand the scenario, but do you need to custom code this, or could you just use a foreach loop? In the ENSDEMO namespace, there's a sample DTL Demo.ComplexMap.Transform.CreateClassBatch.dtl that demonstrates how you'd use a nested foreach to loop through a collection.  

 

Steve

Thanks Steve. Looks like the example has what I needed. I will try it and come back here if I run in to something that I am unable to foresee.