Reputation: 287
I have the following structures:
Strcuture A:
<itemlist>
<item>
<id>123</id>
<price>1</price>
<quantity>1</quantity>
</item>
<item>
<id>124</id>
<price>2</price>
<quantity>1</quantity>
</item>
<item>
<id>125</id>
<price>3</price>
<quantity>1</quantity>
</item>
<itemlist>
Structure B:
<totals>
<total>
<totalPrice>3</totalPrice>
</total>
</totals>
If I want a sumation of all the field multiplied by the field in structure A to be placed into the totalprice field of structure B, would that be possible in the DataMapper.
If it is possible, how would you do it?
Thanks
Upvotes: 1
Views: 35
Reputation: 5115
Yes it is, in datamapper find the mapping of the field 1 and then go to script view. There you will find a datamapper MEL script. Find output.total = input.field1
and add * input.field2
.
Upvotes: 1