How to prepare the config file using JSON format?

Hi all,

Till now while developing the any process I am/was using the excel file as a config file, but now I got a new requirement to create the config file in the JSON format.

Can someone suggest me how can I achieve this??

thanks in advance.

Hi @naveen.s ,
read the config.json file inside the intiallsettings
Deserialize JSON
For Each Property in Object,Add Config key/value pair


image

InitAllSettings.xaml (25.4 KB)

Thanks & Regards,
Sneha

Hi @naveen.s
Go to the imports Panel and import the below.

    Newtonsoft.Json
   System.Collections.Generic
  - WorkbookPath: "path_to_your_excel_file"
  - Read Range
    - SheetName: "Sheet1"
    - Output: dt1
- Assign
  - configDictionary = New Dictionary(Of String, String)
- For Each Row in dt1
  - Assign
    - configDictionary(row("KeyColumn").ToString) = row("ValueColumn").ToString 

 - Assign
   jsonString = JsonConvert.SerializeObject(configDictionary)

- Write Text File
  - FileName: "path_to_your_json_file"
  - Text: jsonString

Output

Hope it helps!!

@naveen.s

Copy Excel Table To Email.zip (179.8 KB)

@pravallikapaluri ,
After that how can I use that as an assets or upload in orchestrator

@naveen.s
May I know what you want to add into assets

@pravallikapaluri ,

like credentials,urls, email ids,shared path , queue name etc

@naveen.s

Copy Excel Table To Email.zip (188.7 KB)

Hope it helps!!

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