API out put to excel

Hi all.
I am practicing on currency converter API, and this is the out put I am getting.
Now I need to write the currency name and value to excel in separate columns.
How can we achieve this.
Thank you

Hey,
Check out this topic

1 Like

@Dinesh_Babu_S

Hello and welcome to the community.
Build a data table with 2 columns for currency code and value (ensure the data types chosen are correct)
You can Use a Deserialize Json activity on the output variable of the API request.
The type argument will be a dictionary of String,String
image
image
Then use a For each activity with Type Argument of Key Value Pair (String,String)
image
item.key will give the currency name
item.value will give the currency value.

They can be added as DataRow into the Data Table created above (within the for loop)
Then they can be added to the Excel sheet.

2 Likes

Hi Sowmya.
Thank you for responding.
But I am getting an error while selecting the Argument type in Deserialize JASON.

Hi @Dinesh_Babu_S

Change the type of argument as

Newtonsoft.json.linq.jobject

Hello Nived.
what is he argument type to be selected in the for each loop?
Currently I have selected “System.Collections.Generic.KeyValuePair<TKey, TValue>”(Getting ERROR: Not all generic types could be resolved).
I just want to write the currency name and currency value in to the data table/Excel.

The argument type to be selected in the for each loop is keyvaluepair(string,string)