Extract data from json file

Hello Everyone,

I am trying to extract the data from json file using Deserailized Json Activity.Please help me to solve this issue. I am attaching the file for reference.Untitled.txt (2.4 KB)

Hi @sneha_arbole,

can you please specify that from the json response what is the parameters or value that you specifically want .

thanks
shikhar

I would like to extract : Address, Invoice For, Invoice Number, Invoice Date, Charges.

assign variable = JSON_Output.SelectToken(“nameofvariable”).tostring

If you have nested items then you may need to deserialize twice.

assign variable should be of genericType or string?

Try either one. I think I used string in my use case.

This looks like was taken from a web application, am i right? Are you sure this is the best way to extract what you need?

Getting error when used generic or string type

yes… this is output i get when analyzed my invoice…

Will be very weird to navigate this object:

MyObj.GetValue("pages")(0)("keyValuePairs")(0)

Is where you will begin to see each group of values… Just iterate in that pages and last keyvaluepairs index to get them all.

OK…i Will try this and let you know

thank you

Websites like this: https://jsoneditoronline.org/ are you friend to better look at you complex json object…

this Syntax is not working for me

Hey,
First, import the following namespaces
image
Next, Create a variable of Jobject type
image
Now, deserialize your json string to Jboject like shown below


Quickly navigate through the available keys using a simple linq query->convert to list->use string.join to convert list in to a string with “,” as a delimiter

You have your address.
image
Follow the same for the rest of the fields.
Detailed workings here for your reference
JsonExercise.zip (13.7 KB)

1 Like

Thank you very much…this is extracting the data but i am not able to extract data from table such as Invoice number…

You have to understand and modify the expression accordingly to extract your preferred data.

ok…Thank you Verymuch

Pls try changing index value after (“keyvaluepairs”) in the expression to get different fields.

i have already tried it… Getting error as Index does not exist

Ohh my bad please change before keyvaluepairs.