Extract value of a json

Hello everyone
This is a response of a sent API.
When i want to manipulate it. An error appears to tell me that there are caracters that dont let me deserialize the response.
I put it in a txt file so i saw that there is enters before the json writing. I think that that’s what blocks.
I want to extract the value of the key. “code”

xx.txt (106 Bytes)

Hi @dhouha.cherif please try this:

image

  1. Read The textfile

  2. Deserialize it

then get the key

Hi @dhouha.cherif ,

I was able to deserialize the Json String to a Json Object using Deserialize Json Activity. We could then use the key code to get the value from the Json Object. Check the below Image :
image

I did but i got this error “Deserialize JSON: Unexpected character encountered while parsing value: . Path ‘’, line 0, position 0.”
Can you try with this file and tell me if you had the same error please
xx.txt (90 Bytes)

I did but i got this error “Deserialize JSON: Unexpected character encountered while parsing value: . Path ‘’, line 0, position 0.”
Can you try with this file and tell me if you had the same error please
xx.txt (90 Bytes)

Find this workflow
New folder.zip (1.7 KB)

Thank you for your response. Can you tell me what is the missing activity so i can remake it ?

Install the package uipath.webapi.activities

I’m so sorry for disturbing
But i keep getting this error

Try it

Json.zip (2.4 KB)

When i use your json file it works
But when i copy and paste mine it does not . Same error

Browse the correct path of the text file

also add log message before deserialize to print the readText file output. May be it returns empty.

@dhouha.cherif ,

Could you try first updating the Packages to the Latest version or the Latest Stable version and check if your workflow works, also we would like to get a view on your Dependencies if it’s possible.

There might be references to the Newtonsoft.Json which maybe different in two different packages and hence it is a possibility for the error.

image