Mapping to JObject when Invoke OpenRPA

Hi,
I have been working with the work item queue example (provided as a helper project) and in addition of the workitem, I would like to map a variable (received from the workitem payload) to JObject to be more easy to manipulate in the workflow.

The workitem.payload looks like

payload: {
	"credentials": {
		"username": "example",
		"password": "123"
	}
}

The payload from the queue is passed as an object, but the credentials is passed as an string. I can access to the value in the workflow using this expression:

JObject.Parse(workitem.payload("credentials").ToString())("username").ToString()

But It’s very tedious to convert every time I want to use some value from my payload, for that reason I was looking to map it to JObject in the Invoke OpenRPA activity, but I am getting next error:

Any idea about how to handle it?
Thanks

Try adding a variable of the type nobject first. Close and reopen the designer and see if that fixes. Else test by browsing to the type again.

Hi Allan.
It was my mistake, I had forgotten to import the Newtonsoft.Json and Newtonsoft.Json.Linq packages. It’s working now.

But I cannot find the way to remove a package from the list once I added it, I select the package and press delete and isn’t deleted from the list.

Regards and thank you a lot.

you can also close the designer and click “edit xaml” on the “open project” tab

1 Like

I got it! I was able to deleted it using editing the xaml.

Thanks and regards

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.