Unable to update attribute value with API PUT Request

Hello Community
Straightforward, I’m still new to API automations, and I have learned the basics from my most recurrent source of learning (YouTube). But still, simple questions can come my way. Mine today is…

What are the possible reasons that this PUT method isn’t updating the data as intended? (Check Images)

As you can see, Im trying to update the value of the attribute “estado” to “initialized”

Thank you in advance for the attention,
Regards

@Luis_Fernando - There is a property (not in the HTTP Request Wizard but in the Properties panel) where you can supply the Body of the request. In projects where I’ve done something similar in the past, I would put something like this in the body:

{
  "estado": "Initialized"
}

The Body property accepts String so it would look like this:

"{
  ""estado"": ""Initialized""
}"

A lot of this depends on how the API was designed by the developers. If they have an official documentation, it may help a lot.

Let me know if the suggestion above works. Thanks!

Hello @argin.lerit, Thank you very much for your answer.

Argin im trying to insert a json format body a bit more complex that the one on your example, and I got to say that it´s been I whole mess :melting_face: when trying to insert the double quotes so it mets the string format. Any advice?


I tried saving the content in a JsonObject variable and just convert to string in the property, but then I remember that I have modify and add some new tokens in the json. I know how to get values but, how can I edit them?

Lets say I have this json

{
“estado”: “error-proceso”,
“error”: true,
“mensaje”: “No se encontró el numero de vuelo”,
“informacionProceso”: {
“totalFilas”: 3106,
“filasProcesadas”: 0,
“filasError”: 20
}
}

How can I store this Json y a JsonObj variable?

@Luis_Fernando - You can use the Deserialize JSON activity from the UiPath.WebAPI.Activities package to convert a string to JSONObj.

image

And then you can edit the json object with Assign:
image

image

Thanks

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