Edit workitem payload

Hello, @Allan_Zimmermann I start using workitems and it’s very helpful.
I would like to know how to change or add a element value in the “object” payload. I want to change two elements, “perfil” and “estado” values depending on what I get the a webpage when processing a item.
Initial payload:

  "cliente": "xpto",
  "perfil": null,
  "estado": null

Want to change “null” for a different value… How do I archive this?

workitem.payload is a dictionary with all the values.
So you can reference the values per name or ID and you can use collection activities on it.
UpdatePayload.xaml (25.1 KB)

@Allan_Zimmermann thank you so much for your support! It works perfectly.

one more things… when I enter in the view of a item, this is what is showing th the top: {{ctrl.model.name}} (title?)

@Allan_Zimmermann I have another question about the IF statement row("key").tostring =workitem.payload("currency").ToString inside the “Foreach DataRow”.
I have more than 30,000 elements to process but every time an item is processed it has to go through each row until a match has been found. It’ll take a lot of time to process everything.

It fills in some data in the corresponding cell of the excel file and workitem.
So… Is there a better way to do that?

Use a filter on the datatable.
Grab the default view and then set a filter on it

Then you can use for each row on the view ( or just .rows )

1 Like

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