cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I get the error "Data items for create work queue requests cannot be empty." when calling the Blue Prism API?

TracyGreen
Level 4

I am calling https://[myhost]/api/v7/workqueues/[myqueueid]/items/batch with this 

 [ {
        "data": {
            "rows": [
                {
                    "valueType""Text",
                    "value""ThisIsMyValue"
                }
            ]
        },
        "priority"3,
        "tags": [
            "Account 123"
        ],
        "status""Pending"
    }]

in the body of my request.  I'm getting 
[
    {
        "invalidField""requestModel[0].data",
        "message""JsonSerializationException\r\n'Data' must not be empty.\r\nThe request contains empty Data items – Data items for create work queue requests cannot be empty."
    }
]

I don't understand this.  I have a data item and it isn't an empty list.  This is following the format from the documentation.  What am I missing here?

Also, the data we're trying to pass is our Key Name.  In our case, the Key Name is a piece of data called Name.  There's no place to specify that in the Data items being passed.

Any assistance would be appreciated.

Tracy Green

 



------------------------------
Tracy Green
Systems Developer III
Federated Insurance
America/Chicago
------------------------------
1 BEST ANSWER

Helpful Answers

John__Carter
Staff
Staff

Hi Tracy - try including the field names like this:

        "data": {
            "rows": [
                {
                    
                    "Field1":{
                        "valueType": "Text",
                        "value": "ThisIsMyValue"
                    },
                    "Field2":{
                        "valueType": "Text",
                        "value": "ThisIsMyOtherValue"
                    }
                }
            ]
        }



------------------------------
John Carter
Blue Prism
------------------------------

View answer in original post

3 REPLIES 3

John__Carter
Staff
Staff

Hi Tracy - try including the field names like this:

        "data": {
            "rows": [
                {
                    
                    "Field1":{
                        "valueType": "Text",
                        "value": "ThisIsMyValue"
                    },
                    "Field2":{
                        "valueType": "Text",
                        "value": "ThisIsMyOtherValue"
                    }
                }
            ]
        }



------------------------------
John Carter
Blue Prism
------------------------------

Hi John,

I have a problem that is in the same alley.

The payload underneath results in the same error message. I'm following the syntax from the guides, but unsure if this the correct way for a Collection.

[
  {
    "data": {
      "rows": [
        {
          "Route": {
            "valueType": "Text",
            "value": "CreateOrder"
          },
          "Package": {
            "valueType": "Collection",
            "value": [
              {
                "Name": {
                  "valueType": "Text",
                  "value": "Test Testerson"
                }
              },
              {
                "Name": {
                  "valueType": "Text",
                  "value": "Test Testerson"
                }
              }
            ]
          }
        }
      ]
    },
    "priority": 5,
    "status": "Pending"
  }
]



------------------------------
Vemund Fjeld
------------------------------

Hi Vemund - try something like this, where Field3 the collection field

"data": {
	"rows": [
		{	
			"Field1":{
				"valueType": "Text",
				"value": "ThisIsMyValue"
			},
			"Field2":{
				"valueType": "Text",
				"value": "ThisIsMyOtherValue"
			},
			"Field3":{
				"valueType": "Collection",
				"value": {
					"rows": [
						{							
							"Field3a":{
								"valueType": "Text",
								"value": "Row1"
							}
						},
						{
							
							"Field3a":{
								"valueType": "Text",
								"value": "Row2"
							}
						},
						{
							
							"Field3a":{
								"valueType": "Text",
								"value": "Row3"
							}
						}
					]
				}
			}
		}
	]
}


------------------------------
John Carter
Blue Prism
------------------------------