Requisição HTTP com autenticação

Olá,

Estou recebendo a mensagem Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken.

Pode me ajudar?


@Allan_Zimmermann consegue me ajudar?

The error is pretty clear, you need to change the type of the argument, of figure out why your http node is returning something different.

Minha api retorna um array com vários objetos e não estou sabendo lidar com isso no OpenRPA
image
image

Já tentei alterar o tipo do argumento mas não resolveu. Procurei vídeos de OpenRPA com Node-Red para requisição HTTP que retorne um array, mas não encontrei. Os vídeos que encontrei, a requisição sempre retorna um objeto.

Já tentei usar o conversor json
image

you need to return an object, but you can set a property to an array
So add a function node after the http request, and assign the payload to a new payload with the result as an property

msg.payload = { myarray: msg.payload }

Now you can receive the result in openrpa using “myarray” as an argument/variable
The type depend on what is in the array, you haven’t show that.
for simple types, like strings, you cold make the variable array of string, for more complex things, you can either use datatable or JArray/array of JObject and work with the data as a dictionary

1 Like

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