Get data from Json in Excel

Hi can someone please help me

I have to do the following

if the amount of the invoice and the name of the supplier are the same (red boxes), then I must obtain from the json that is in column I some data (blue boxes) and add them to an excel

there I have the expected result

@GDMM

Please follow

First to get unique combination of name and invoice use in assign uniquedt = dt.Defaultview.ToTable(True,“Name”,“invoice”)

Now use a for loop on the uniquedt and inside it use a filter on the main dt to get all the invocie rows related to the given name and invoice in the filter conditions

Now use another loop on the filtereddt to get each json values and add them

to get the json values use deserialize json activity(Download UiPath.Webapi.Activities package) and output would be jobj

Then as per structure jobj(“DynamicProperties”)(“ID de proveedor”).ToString, similar get the other values

cheers

dt single = dt.Defaultview.ToTable(True, “Name”, “invoice”)

what would this part be for?

@GDMM

As mentioned above it is to get the unique invoice and name values to use later as you need

cheers

@GDMM

Did you change the type argument in deserialize json to jobject? If not please do it…and on right you have to use the output of deserialize activity not the string value that you gave as input

Jsoninfo as I see is the input for deserialize activity …please change it to the output variable

And if still error persists please show the error message

Cheers

@GDMM

Can you expand and show the jsonjson output please…

And …can you please check if the keys that we write are exactlyatching…they are case sensitive…please exactly matching with input key names

Cheers

the mistake was the capital letter, thank you very much

1 Like

sorry, I already have the same is the dtSlect variable
but the rest of the data is in the dtExcel

I need it to only extract the values from the excel of the rows that appear in dtSlect
I do not know if I explained well
I did so but it doesn’t work for me

@GDMM

Can you please explain what you have an what you want…

Are you saying you hvae some data in dtselect and depending on that only related data to be extracted from
Jaon?

If yes…then while extracting first check the related values usong if condition if its matchi g with dtselect…

Cheers

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