Skip to content

Commit

Permalink
Add Transform Data Example (#106)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksandar Aytov <[email protected]>
  • Loading branch information
alexaytov and aleks-aytov authored Jul 11, 2024
1 parent 87e044f commit 947f30e
Show file tree
Hide file tree
Showing 3 changed files with 489 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Table of Contents
* [Neo](#neo)
* [Scripting](#scripting)
* [Automation Pilot](#automation-pilot)
* [Utility Commands](#utility-commands)
* [Resources](#resources)
* [Known Issues](#known-issues)
* [How to obtain support](#how-to-obtain-support)
Expand Down Expand Up @@ -117,6 +118,12 @@ After importing, you'll see a new catalog tile - **Automation Pilot Examples**.
|---------|-------------|
| [Backup Catalog to GitHub](backup-catalog) | Backup catalog's content to GitHub |

### Utility Commands

| Example | Description |
|---------|-------------|
| [Transform Data](transform-data) | Transform Data between different formats - JSON, XML, YAML, and CSV |

## Resources

Check out the following resources if you want to get familiar with Automation Pilot:
Expand Down
71 changes: 71 additions & 0 deletions transform-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Transform Data

Table of Contents

* [Description](#description)
* [Requirements](#requirements)
* [How to use](#how-to-use)
* [Expected result](#expected-result)

## Description

The commands attempts to transform data from the source data type to the target data type.
Currently this commands transforming data from and to:
* JSON
* XML
* YAML
* CSV

## Requirements

There are no requirements to use this command.

## How to use

Enter the required input keys:
* data
* sourceFormat
* targetFormat

## Expected result

The expected result is to received the output data in the target format.

### Examples

* Transforming XML to JSON
Input:
```
<xml name="John" age="25">Hello</xml>
```
Output:
```
{
"xml": {
"@name": "John",
"@age": 25,
"$": "Hello"
}
}
```

* Transforming JSON to CSV
Input:
```
[
{
"name": "John",
"age": 25
},
{
"name": "Monica",
"age": 23
}
]
```
Output:
```
name,age
John,25
Monica,23
```
Loading

0 comments on commit 947f30e

Please sign in to comment.