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": ""
      }
    ]
  }
}
11 REPLIES 11

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.

Hi @zdenek.kabatek , 

I see that you have a "tags" attribute. Have you by any chance passed multiple values to this array as parameters to the Web API service? Blue Prism documentation does not clearly state how these must be passed in although it does say that leading square bracket must be escaped using "[[".

thanks

andymenon_0-1742327426779.png