Build a safety issue solution using SharePoint and Power Automate- Part 2

In the first part of this blog series, we used a Power Automate button to report safety issues and a SharePoint list to store the entry. In this post we continue to build upon our solution by adding:

  • A new list to categorize and assign safety issue types.
  • Attributes to reflect the business process.
  • List column formatting to highlight status changes.
  • New actions to original Flow to parse out the file name.

Create a new list called “SafetyIssueType” with an additional Person column named “Responders”. Add a new entry, set “Title” to “Admin” and “Responders” to your account.

Add the following columns to the “Safety Issue” list:

  • “Status” a Choice column type with the following choices: “New”, “In-progress”, “On-hold”, “Closed”, “Rejected”.
  • “Issue Type” a Lookup column type that gets information from “Safety Issue Type” and references the “Title” column.

Format the “Status” by clicking “Column Setting” and then “Format this column”.

Select the default “Format choice options” and then click “Save”.

I set the formatting styles to:

  • Red for “New”.
  • Yellow for “In-progress”.
  • Green for “Closed”.

Once complete your list will look similar to the image below:

Let’s jump into Power Automate and update our existing Flow by clicking “Automate”, “Power Automate” and then “See you flows”. Did you notice that “Automate” replaced “Flow”?

Copy the entire JSON payload listed below:

{
    "type": "object",
    "properties": {
        "user": {
            "type": "object",
            "properties": {
                "displayName": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                }
            }
        },
        "key-button-timestamp": {
            "type": "string"
        },
        "key-button-date": {
            "type": "string"
        },
        "file": {
            "type": "object",
            "properties": {
                "contentBytes": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        }
    }
}

Edit “Log safety issue – Part 1″, rename it to ““Log safety issue – Part 2” and then:

  • Add a new Parse JSON action after the “Manually trigger a flow” trigger and then:
    • Set “Content” to “Body” from “Manually trigger a flow”.
    • Set “Schema” to the JSON payload copied from the previous step.
  • Update the “Create item – Safety Issue” action and set “Status Value” to “New”.
  • Update the “Add attachment – Add Picture to Safety Issue” action and set “File Name” to “name” from Parse JSON.
  • Update the “Send an HTTP request to SharePoint – Set Picture to attachment” and replace “Timestamp.png” with “name” from Parse JSON.
  • Add an Outlook “Send and email (V2)” action and then:
    • Set “To” to “Created By Email” from Create item – Safety Issue.
    • Set “Subject” to “Safety issue successfully submitted”.
    • Set “Body” to “Thank you for letting us know there is a safety issue. Our team will be notified and will start our investigation shortly.”.

Testing “Log safety issue – Part 2” will produce similar results to Part 1 without the “hack” filename and the submitter will receive an acknowledgment email.

In our next blog post we will include an approval to ensure the safety issue submission is legitimate and categorize the work to be completed.

Thanks for reading.

NY

2 thoughts on “Build a safety issue solution using SharePoint and Power Automate- Part 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s