cancel
Showing results for 
Search instead for 
Did you mean: 

Convert string to object&Arrary

sdeng
New Contributor II

I have a input csv data like below:
image
how to format & group the data to like below and how to pass the values to worker_reference
image

2 REPLIES 2

tstack
Former Employee

Are you trying to fit all of the rows from the input into the $Worker_Reference.ID array? Like so:

{
    Worker_Reference: {
        ID: [
            { type: "Employee_ID", value: "A4" },
            { type: "Employee_ID", value: "A3" },
            { type: "Employee_ID", value: "A2" },
            { type: "Employee_ID", value: "A9" }
        ]
}

Or, is every row still a separate document, like so:

// Document #1
{
    Worker_Reference: {
        ID: [
            { type: "Employee_ID", value: "A4" }
        ]
}

// Document #2
{
    Worker_Reference: {
        ID: [
            { type: "Employee_ID", value: "A3" }
        ]
}

// ...

And, where does the $Provisioning_Group value fit in?

sdeng
New Contributor II

It’s the first one, the target customized envelope is like below:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/
xmlns:ns0=“urn:com.workday/bsvc”>
SOAP-ENV:Header
ns0:Workday_Common_Header
ns0:Include_Reference_Descriptors_In_Response$Include_Reference_Descriptors_In_Response</ns0:Include_Reference_Descriptors_In_Response>
</ns0:Workday_Common_Header>
</SOAP-ENV:Header>
SOAP-ENV:Body
<ns0:Put_Provisioning_Group_Assignment_Request ns0:version=“$version”>
ns0:Provisioning_Group_Assignment_Data
ns0:Worker_Reference#foreach($ID in $Provisioning_Group_Assignment_Data.Worker_Reference.ID)
<ns0:ID ns0:type=“$ID.type”>$ID.value</ns0:ID>#end
</ns0:Worker_Reference>
ns0:Provisioning_Group$Provisioning_Group_Assignment_Data.Provisioning_Group</ns0:Provisioning_Group>
</ns0:Provisioning_Group_Assignment_Data>
</ns0:Put_Provisioning_Group_Assignment_Request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>