cancel
Showing results for 
Search instead for 
Did you mean: 

Blue Prism Web API with collection.

LasseSørensen
Level 3

Hi. Im having big problems getting a Web API to take data from af collection and sending a message.

My Template is like this.

{ 
  "MessageBody": {
    "LegalEntityId": "[LegalEntityID]",
    "SourceSystem": "[SourceSystem]",
    "JournalLines": [
      {
        "SourceSystemId": "[JournalLines_new.SourceSystemId]",
        "Date": "[JournalLines_new.Date]",
        "ProjectId": "[JournalLines_new.ProjectId]",
        "EmplId": "[JournalLines_new.EmplId]",
        "ICWarehouse": "[JournalLines_new.ICWarehouse]",
        "ICLocation": "[JournalLines_new.ICLocation]",
        "Qty": [JournalLines_new.Qty],
        "ItemId": "[JournalLines_new.ItemId]",
        "WorkorderId": "[JournalLines_new.WorkorderId]"
      }
    ]
  }
}

In the object i have two dataitems called "LegalEntityID", and "SourceSystem", and a Collection called "JournalLines_new"

It takes the LegalEntityID, and SourceSystem correctly, but the collection beings passed to the object that handles the API call is being ignored.

I have tried the Utility - JSON to convert the collection to a JSON string and skipping the internal collection completely, but the message being sent is always blank apart from LegalEntityID and Source system.

This is a grab of the RequestData output.

Content-Length: 362
Expect: 100-continue
Connection: Keep-Alive
{ 
  "MessageBody": {
    "LegalEntityId": "Test",
    "SourceSystem": "RPA",
    "JournalLines": [
      {
        "SourceSystemId": "",
        "Date": "",
        "ProjectId": "",
        "EmplId": "",
        "ICWarehouse": "",
        "ICLocation": "",
        "Qty": ,
        "ItemId": "",
        "WorkorderId": ""
      }
    ]
  }
}
10 REPLIES 10

LasseSørensen
Level 3

Hi Everybody.

I think i have fixed it 😄

Now at least the RequestData output fills in my data.

The fix was to send the Collection to the Object, use a MultiCalc step, to split it into single dataitems, and then pass those to the call.
35272.png35273.png35274.png

Right now i am waiting for someone on the other end to veryfy that something has been recieved.