Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

Use Chat GPT to document Power Automate Flows - combine JSON rows

Posted on by 109
Hi, 
I have the requirement to document a list of Flows and Workflows from an environment.  In lieu of doing this in a manual and painstaking way, opening each Flow and documenting one by one in an excel template, I want to use Chat GPT prompts to document these in a table for me - listing each with a Process Name, Table name, Trigger, Condition(s), Action(s), etc.   

At this point I have a list of 163 Flows in a folder from solution that I exported.  They are each JSON files.  I tested out using Chat GPT to document the Flow by opening the first JOSN file, copying the code into a prompt, and telling Chat GPT to document it for me, calling out the columns in a table that I desired.  This worked.  

However, I don't want to open up each JSON file and do this over and over 162 more times.  So, I am looking for an efficient way to combine all 163 rows (or at least batches at a time) into a prompt so that this can be an easier process.   I don't know of a way to include the file itself into the prompt...is there a better way to get this done?  Looking for any ideas or suggestions.  Below is an example prompt I used for one line of JSON. 
Thanks in advance!  

I have a Dynamics 365 process, create a table that tells me the trigger, the table, the actions and what is updated based on the following definitions: <insert JSON code snippet here>
 
  • haseem Profile Picture
    haseem 25 on at
    Use Chat GPT to document Power Automate Flows - combine JSON rows
    Using Python you can combine them into a single JSON array 
    Ex..
     
    import os
    import json
    # Path to the folder containing JSON files
    folder_path = 'path/to/json/files'
    # List to hold combined JSON data
    combined_data = []
    # Iterate through all JSON files in the folder
    for filename in os.listdir(folder_path):
        if filename.endswith('.json'):
            with open(os.path.join(folder_path, filename), 'r') as file:
                data = json.load(file)
                combined_data.append(data)
    # Save combined data to a new JSON file
    with open('combined_flows.json', 'w') as outfile:
        json.dump(combined_data, outfile)
     
     
    create a prompt for ChatGPT includes multiple JSON rows.
     
     
    [
        {
            "Process Name": "Process 1",
            "Table Name": "Table 1",
            "Trigger": "When a record is created",
            "Conditions": "Status is Active",
            "Actions": ["Send an email", "Update record"]
        },
        {
            "Process Name": "Process 2",
            "Table Name": "Table 2",
            "Trigger": "When a record is updated",
            "Conditions": "Priority is High",
            "Actions": ["Create a task", "Notify manager"]
        }
        // Add more JSON rows as needed
    ]

     
     
    Use this prompt to instruct ChatGPT to generate a table from the combined JSON data.
     
    I have a Dynamics 365 process. Create a table that tells me the process name, table name, trigger, conditions, actions, and what is updated based on the following JSON data:
    [
        {"Process Name": "Process 1", "Table Name": "Table 1", "Trigger": "When a record is created", "Conditions": "Status is Active", "Actions": ["Send an email", "Update record"]},
        {"Process Name": "Process 2", "Table Name": "Table 2", "Trigger": "When a record is updated", "Conditions": "Priority is High", "Actions": ["Create a task", "Notify manager"]}
        // Add more JSON rows as needed
    ]
    Generate a table with columns: Process Name, Table Name, Trigger, Conditions, Actions, and Updates.
     
     
    I hope it helps 
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Use Chat GPT to document Power Automate Flows - combine JSON rows
    Hi Partner,
    Based on your description:
    Essentially, you want to know how to log multiple Json files using Chat GPT.
    Maybe you need to find forums where chat GPT is discussed for help!
    Because the current forum is for discussing Dynamics 365 related products themselves.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans