im using this tip to get some info from a txt> https://docs.uipath.com/activities/docs/deserialize-json
but i dont know how to get specific itens inside the “0001”, i want to consult with deserialize json but i want this 3 infos in 3 differents variables, is that possible ? in the link, when i call cars, he get all the 3 infos in one string, how to split it
all 3 infos in the same string ><
You can use:
you could use a second Deserialize Json activity to split the contents of your token “0001” into tokens themselves.
Send the contents of your token “0001” into a Deserialize Json activity like this:
Then get the separate information like this:
It only gets tricky if you don’t know how deep the Json goes.
Hope this helps
Lets try to understand you in amore clear way. A JsonObject defines a property “0001” and its value is a JSONObject again - lets refer to it with jo2
we do understand from you statement that it is unknown how many properties
jo2 does have, right?
give a try on following:
what is shown in the output?
yes, the problem with the first and second solution is that each item will have date, value and document type, but the “0001” will be different, my robot know “0001” number and need to give me the other 3 results, i was able to do then individually using a simple txt like this
than the robot input the 0001 and output the date.
but i will have to do 3 differents txt and select the same token 3 times to do than, im trying to get all the info into one code
dont know if you get what i need, im using google translator here
Important is to respect the different structures and to have it included into the requirement / case description.
The approach for it is similar along with a nested loop:
Input / output:
kindly note the dynamics, showcased with the additional comment: ABC
Parsing to a dictionary
Sometimes we want to Extract the data to a particular datastructure and here a Dictionary can help. The flow would look like this:
Output / Access Demo:
Deserializing to nested Dictionary
Doing similar to above (Parsing to a dictionary) we can do it directly within an assign
Find starter help here:
DynProps_ObjectExtraction_Log-Dict_Demo.xaml (10.0 KB)
data.json (308 Bytes)
You can use
.SelectToken for all levels that you need:
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.