Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

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

(1) ShareShare
ReportReport
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 23 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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,883 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans