Inspiration

What it does

How I built it

Challenges I ran into

Accomplishments that I'm proud of

What I learned

What's next for ReadConfigXml

"Read Json or Xml" Custom Activity

This Uipath Custom activity takes two inputs - "File Path" of Json or Xml file and "File Type" as Json or Xml and returns a dictionary output that consists of Key Value pair of

  1. Xml child nodes' names (along with all parent node names separated by underscore) and their values in case of Xml input and
  2. Json properties' names (along with all parent property names separated by underscore) and their values in case of Json input

In case of multiple xml nodes or Json properties with the same name and at the same heirarchy level the mutiple keys' names will be separated by underscore and numeric values.

Youtube Demo URL - https://www.youtube.com/watch?v=5dh09MdG_Ko

For E.g. - In case of a Json file as shown below -

{ "id": "0001", "type": "donut", "name": "Cake", "ppu": 0.55, "batters": { "batter": [ { "id": "1001", "type": "Regular" }, { "id": "1002", "type": "Chocolate" }, { "id": "1003", "type": "Blueberry" }, { "id": "1004", "type": "Devil's Food" } ] }, "topping": [ { "id": "5001", "type": "None" }, { "id": "5002", "type": "Glazed" }, { "id": "5005", "type": "Sugar" }, { "id": "5007", "type": "Powdered Sugar" }, { "id": "5006", "type": "Chocolate with Sprinkles" }, { "id": "5003", "type": "Chocolate" }, { "id": "5004", "type": "Maple" } ] }

This Json file returns a Dictionary of Key Value pairs as shown below -

id - 0001 type - donut name - Cake ppu - 0.55 batters_batter_id - 1001 batters_batter_type - Regular batters_batter_id_1 - 1002 batters_batter_type_1 - Chocolate batters_batter_id_2 - 1003 batters_batter_type_2 - Blueberry batters_batter_id_3 - 1004 batters_batter_type_3 - Devil's Food topping_id - 5001 topping_type - None topping_id_1 - 5002 topping_type_1 - Glazed topping_id_2 - 5005 topping_type_2 - Sugar topping_id_3 - 5007 topping_type_3 - Powdered Sugar topping_id_4 - 5006 topping_type_4 - Chocolate with Sprinkles topping_id_5 - 5003 topping_type_5 - Chocolate topping_id_6 - 5004 topping_type_6 - Maple

For E.g. in case of xml file as shown below -

<?xml version="1.0" encoding="UTF-8"?>

Everyday Italian Giada De Laurentiis 2005 30.00

Harry Potter J K. Rowling 2005 29.99

XQuery Kick Start James McGovern Per Bothner Kurt Cagle James Linn Vaidyanathan Nagarajan 2003 49.99

Learning XML Erik T. Ray 2003 39.95

The resulting Dictionary of Key Value pair is as shown below -

book_title - Everyday Italian book_author - Giada De Laurentiis book_year - 2005 book_price - 30.00 book_title_1 - Harry Potter book_author_1 - J K. Rowling book_year_1 - 2005 book_price_1 - 29.99 book_title_2 - XQuery Kick Start book_author_2 - James McGovern book_author_3 - Per Bothner book_author_4 - Kurt Cagle book_author_5 - James Linn book_author_6 - Vaidyanathan Nagarajan book_year_2 - 2003 book_price_2 - 49.99 book_title_3 - Learning XML book_author_7 - Erik T. Ray book_year_3 - 2003 book_price_3 - 39.95

Built With

Share this project:
×

Updates