Hi.
I'm creating a workflow in K2 to create a Purchase Request. the last step in the workflow will actually call a REST Web Api by posting one JSON parameter that contains all values, inlcuding the header and the list of details of the Purchase Request.
To simplify it:
the Json has three parameters: ID, Date, Items[].
and each Item has two parameters: Id, Quantity
I have a Form that contains:
- a Header View that includes the ID, the Date....
- a list view that includes the Items required, each item contains the ID, the quantity...
- a Create Button
The Create button is supposed to call the web service and post the serialized values of the header and the list of items as well. the only thing I need is how to serialize the whole list of items?
what I did is some rules on the button click:
- on the list: Serialize the list Item to Array by doing the requierd mapping
- on the list: Save the output mapping to a data label 1
- on the header: Serialize the header by doing the required mapping and mapping the data label 1 to Itemse]
- on the header: Save the output mapping to data label 2
- call the Smart object Method by supplying the data label 2
the problem here is the first step: Serialize Item to Array is serializing only the selected line in the list and not the whole list!!!
any suggestions?