Automated Contract Monitoring and Notification System
A detailed guide to building a Power Automate workflow for monitoring SharePoint lists for red-formatted cells, extracting relevant data, and sending email notifications.
Automated Contract Monitoring and Notification System
Description
This project focuses on creating a Power Automate flow to start every Monday at 8 am. It will scan a SharePoint list for cells formatted in red, extract the corresponding Vendor name and Contract number, and send this information via email to the relevant stakeholders found in the same SharePoint list. The curriculum units will cover setting up the necessary tools, creating the flow, configuring the actions, validating the workflow, and optimizing the system for better performance.
The original prompt:
show me ALL THE steps in detail on how to do a power automate flow starting on monday at 8 am every week that goes to a sharepoint list and finds cells that are formatted red and then extracts the Vendor name which is in the column entitled “Vendor” and the contract number which is in the column entitled “Contract #” and puts that vendor name and contract number in outlook emails. thank you.
For the output, I want an email to be sent to people WHO ARE FOUND in a Sharepoint list who had cells that were formatted red, and I want in the body of the email A list of the vendor name and contract number that is found in the same row as each occurrence of the red cells.
These software tools that would be used are sharepoint and Microsoft Outlook.
Building a Power Automate Workflow for Monitoring Red-Formatted Cells in SharePoint Lists
Introduction
In this guide, you will learn how to create a Power Automate workflow to monitor SharePoint lists for red-formatted cells, extract relevant data, and send email notifications.
In the Build an automated flow dialog, name your flow (e.g., "Monitor Red Cells in SharePoint List").
Under Choose your flow's trigger, search for When an item or a file is modified and select it.
Click Create.
Configure the Trigger:
Choose the Site Address and List Name from the available SharePoint sites and lists.
Step 2: Initialize Variables to Track Red Cells
Add a New Step:
Click on + New step.
Search for Initialize variable and select it.
Configure the Variable:
Set the Name to RedCellValues.
Set the Type to Array.
Step 3: Retrieve and Check Cell Formatting
Add a New Step:
Search for Get items and select it under the SharePoint connector.
Configure the Get items Action:
Set the Site Address and List Name to match your SharePoint list.
Add an Apply to Each Control:
Click on + New step.
Search for Apply to each and select it.
Configure the Apply to Each:
Set its output to the value of your Get items action (e.g., value).
Check for Red Formatting:
Inside the Apply to Each control, add a Condition.
Configure the Condition:
In the first box, select the relevant cell properties (field name likely containing the color information) from the output.
Set to equals and choose a red identified by its color code (e.g., #FF0000 for HTML red).
Step 4: Collect Red Cell Data
Add a New Step inside the If Yes branch of the Condition:
Search for Append to array variable.
Configure the Append to array variable Action:
Set the Name to RedCellValues.
Set the Value to extract the necessary data from the red cell (could be the content of the cell itself).
Step 5: Send Email Notification
Add a New Step after the Apply to Each loop:
Search for Send an email (V2) and select it from the Outlook connector.
Configure the Email Notification:
Set the To field to the intended recipients.
Set the Subject appropriately (e.g., "Alert: Red-Formatted Cells Detected").
In the Body, include the array variable RedCellValues. You might need to format this data as needed.
Final Workflow Summary
Trigger the flow when an item in the SharePoint list is modified.
Initialize an array variable to store the values of the red-formatted cells.
Retrieve the items from the SharePoint list and iterate through each item.
Check if the cell has red formatting.
Collect data from red-formatted cells.
Send an email with the details.
Conclusion
By following this step-by-step guide, you can set up a Power Automate workflow that monitors for red-formatted cells in a SharePoint list, extracts the relevant data, and sends email notifications to the desired recipients.
Building and Scheduling a Power Automate Flow
Here is a detailed step-by-step guide to building a Power Automate workflow for monitoring SharePoint lists for red-formatted cells, extracting relevant data, and sending email notifications.
Name your flow (e.g., "Monitor SharePoint Red Cells") and choose a trigger. Select "When an item is created or modified" from the SharePoint connector.
Step 2: Connect to the SharePoint List
Select your SharePoint site from the dropdown or enter the site URL.
Select the relevant list from the dropdown.
Step 3: Initialize Variables
Add a new step, then choose Initialize variable from the actions.
Name: redCells
Type: Array
Value: Leave blank
Step 4: Apply to Each - Iterate Over the List Items
Add a new step, then choose Get Items from the SharePoint connector.
Site Address: Your SharePoint site URL
List Name: Your SharePoint list
Add a new step, then choose Apply to each from the control actions.
Select the output from Get Items (value).
Step 5: Extract Cells with Red Formatting
Inside the Apply to each, add a new step, then choose Get item from the SharePoint connector.
Site Address: Your SharePoint site URL
List Name: Your SharePoint list
Id: ID (from the Apply to each context)
Add a condition to check if the cell background color is red (this assumes you have a column capturing cell color).
Condition: Choose your column that stores cell background color.
Operator: Equals
Value: #FF0000 (red color in hexadecimal)
Step 6: Append Red Data to Variable
If the condition is true, add an action to append to the array variable.
Variable: redCells
Value: @{triggerBody()?['ColumnForDataYouNeed']} (replace ColumnForDataYouNeed with the column name that stores your data)
Step 7: Send Email Notification
Outside the Apply to each loop, add a new step, then choose Send an email (V2) from the Office 365 Outlook connector.
Configure the email:
To: Your target email address
Subject: Red Cell Alert in SharePoint List
Body: You can use the redCells variable to include the relevant data. Use expressions like join(variables('redCells'), ', ') to format the data in the email body.
Step 8: Save and Test the Flow
Click on Save to save your flow.
Click on Test and follow the steps to ensure everything is working.
Monitor the run history to check for any errors and ensure emails are triggered appropriately.
Scheduling the Flow
Power Automate inherently triggers on SharePoint item creation or modification, but if you need to schedule the flow:
Navigate to the trigger of the flow.
Add a new step at the top and select the Recurrence trigger from the Schedule connector.
Configure the recurrence settings (e.g., every hour, daily, etc.).
This setup ensures the flow will run on a predefined schedule, checking for updated or newly created items.
Conclusion
This guide provides you with a comprehensive implementation for building and scheduling a Power Automate flow that monitors a SharePoint list for red-formatted cells, extracts relevant data, and sends email notifications. Apply these steps as they are provided to achieve your workflow automation goals.
Example Email Body Expression
join(variables('redCells'), ', ')
Use the provided Markdown snippet to format your email body dynamically using the redCells variable.
Configuring Actions for Data Extraction in Power Automate
In this section, we will focus on configuring actions within Power Automate to monitor a SharePoint list for cells formatted in red and extracting the relevant data. After extraction, we will set up the workflow to send email notifications.
Step-by-Step Configuration
1. Set Up a Trigger for Monitoring Changes
Trigger: Use the "When an item is created or modified" trigger and select your SharePoint site and list (configured in earlier sections).
2. Initialize Variables
Action: Initialize a variable for storing red-formatted cell values.
This step-by-step guide demonstrates how to configure Power Automate to monitor a SharePoint list for red-formatted cells, extract relevant data, and send email notifications accordingly. By following these structured actions, you can implement an automated process that responds efficiently to the conditions set within your SharePoint environment.
Automating Email Notifications with Outlook using Power Automate
Overview
This guide will help you automate email notifications with Outlook when specific conditions are met in a SharePoint list. The automated workflow will monitor the SharePoint list for red-formatted cells, extract relevant data, and send email notifications using Power Automate.
Detailed Steps
Step 1: Trigger Configuration
Go to Power Automate and create a new Flow.
Select "When an item is created or modified" as the trigger and connect it to your SharePoint list.
Site Address: Choose your SharePoint site from the dropdown.
List Name: Select your SharePoint list.
Step 2: Condition to Identify Red-Formatted Cells
To detect red-formatted cells, we'll use a column in SharePoint to indicate items that need attention.
Add a new Condition action.
Expression:
if empty(items('Apply_to_each')?['ColumnName']) or condition_to_check_red_format
For example, if the column "Status" equals "Urgent", which is marked by the red formatting:
Condition: Check for 'Urgent' status (indicated by red format).
Get item: Retrieve item details.
Send an email (V2): Compose and send an email notification with the retrieved item details.
This setup will ensure that whenever an item in your SharePoint list is marked with red formatting (e.g., status 'Urgent'), an automated email notification will be sent using Outlook.
By following these steps, you'll have a fully functional Power Automate workflow that monitors your SharePoint list and sends notifications when necessary conditions are met.
Testing, Validation, and Optimization Techniques for Power Automate Workflow
This section covers practical methods for ensuring the reliability and efficiency of your Power Automate workflow that monitors SharePoint lists and automates email notifications based on red-formatted cells.
Testing the Workflow
Unit Testing
Create Test Cases: Define a set of test cases that cover different scenarios, e.g., cells turning red, no cells turning red, and multiple cells turning red.
Use Sample Data: Prepare a SharePoint list with entries that can simulate these scenarios.
Run Workflow Manually: Execute the Power Automate flow manually using these sample data entries.
Check Output: Verify that emails are sent only for rows where cells are red-formatted and that the content is correct.
Runtime Logs
Enable Logging: Use the 'Compose' and 'Append to array variable' actions in Power Automate to log key steps in your workflow.
Log Details: Include details such as list item ID, column name, color state, time of change, and email success or failure status.
Error Handling
Configure Error Handling: For each critical action, especially for data extraction and sending emails, use the 'Configure run after' setting to specify what should happen if an action fails.
Fallback Mechanism: Implement a fallback mechanism that logs errors and notifies an administrator.
Validation Techniques
Validation Rules
Data Validation: As soon as data is extracted from the SharePoint list, use condition actions to validate the data.
if (cellColor == 'red'):
proceed with processing
else:
skip
Email Validation: Validate email addresses to ensure emails are sent to the correct recipients.
if (isValidEmail(recipientEmail)):
send email
else:
log error
End-to-End Testing
Perform full run-through tests to ensure the entire workflow works correctly from starting the flow to receiving email notifications.
trigger(flowStart)
extract(data)
validate(data)
if (dataValid):
format(emailContent)
send(email)
Optimization Techniques
Reduce API Calls
Batch Processing: If applicable, batch process SharePoint list items to minimize the number of API calls.
for (items in batch):
process(item)
Conditional Actions: Use conditions and switch cases to avoid unnecessary actions.
switch(cellColor):
case 'red':
send notification
case 'non-red':
continue
Optimize Data Fetching
Use Filters: Apply OData filters to queries to fetch only the necessary data.
filter=query?color eq 'red'
Minimize Workflow Duration
Parallelism: Where appropriate, use parallel branches in Power Automate to execute independent actions simultaneously.
Delay and Retry: Use delay functions and retry policies to handle transient errors gracefully and reduce impact on performance.
if (actionFails):
delay(retryInterval)
retry(action)
Limit Scope: Fine-tune the scope of your flow to handle only relevant data changes.
By following these Testing, Validation, and Optimization Techniques, you can ensure that your Power Automate workflow for monitoring SharePoint lists is reliable, accurate, and efficient.
Remember, these techniques are geared towards practical application; ensuring that any issues are identified, handled gracefully, and workflows are optimized for better performance and durability.
Power Automate Workflow Implementation for Red-Formatted Cells
Step 7: Including RedCellValues in the Email Body
Objective: Include the array variable RedCellValues in the body of an email notification within Power Automate.
Prerequisites
A SharePoint list is already configured and monitored.
Relevant data with red formatting is identified and stored in the variable RedCellValues.
Implementation
Access the Power Automate Workflow:
Open your existing Power Automate workflow where you scan the SharePoint list and gather the red-formatted cells data.
Add an Email Notification Action:
Navigate to the next step in your workflow where the email notification is to be triggered.
Click on + New step.
Search for Send an email (V2) and select it.
Configure the Email Action:
To: Enter the recipient's email address or your desired recipient list.
Subject: Provide your preferred subject line.
Insert RedCellValues into the Email Body:
In the Body section, include the array variable RedCellValues as follows:
Here is a pseudocode example to guide you on formatting the email body, considering the values are extracted from the array and concatenated into a string:
// Convert RedCellValues array to a string with each value on a new line
string emailBodyContent = "The following cells are red-formatted:\n";
for each value in RedCellValues:
emailBodyContent += value + "\n";
// Use emailBodyContent in the email body
Email Body: "Below are the red-formatted cells found in the SharePoint list:\n" + emailBodyContent
Example Configuration:
Here is what it might look like in the Power Automate visual designer:
To:recipient@example.com
Subject:Alert: Red-Formatted Cells Detected in SharePoint List
Body:
Below are the red-formatted cells found in the SharePoint list:
@{
join(outputs('RedCellValues'), '
')
}
```
Save and Test the Workflow:
Save your flow.
Test the flow by triggering it based on your pre-defined conditions to ensure that the email contains the values from RedCellValues.
By following these steps, you will be able to dynamically include the values of the red-formatted cells in an email notification sent from Power Automate. This ensures stakeholders are informed with the precise data condition monitored from the SharePoint list.
Step-by-Step Guide for Monitoring SharePoint Lists with Power Automate
Introduction
This guide helps you build a Power Automate workflow to monitor SharePoint lists for red-formatted cells, extract relevant data, and send email notifications.
Prerequisites
You have a SharePoint list created.
You have access to Power Automate.
Workflow Overview
Trigger the Flow: Start the workflow when an item is created or modified in the SharePoint list.
Get List Items: Fetch items from the SharePoint list.
Check Formatting: Find items with red-formatted cells.
Extract Data: Retrieve relevant data from the formatted cells.
Send Email Notifications: Email the extracted data.
Detailed Steps
Step 1: Trigger the Flow
Open Power Automate and click on Create > Automated Flow.
For the trigger, select When an item is created or modified.
Provide the necessary information:
Site Address: Your SharePoint site URL.
List Name: Your specific SharePoint list name.
Step 2: Get List Items
Click on + New Step.
Select Get items from the SharePoint connector.
Configure:
Site Address: Your SharePoint site URL.
List Name: Your specific SharePoint list name.
Step 3: Check Formatting
Click on + New Step.
Select Apply to each to iterate through items.
Inside Apply to each, add an action Condition to check for red formatting. Since Power Automate doesn't natively support cell formatting, use a different flag in your SharePoint list indicating red cells:
If yes: Based on your specific flag condition.
Configuration for Condition:
Choose value: Select value from the SharePoint item representing red format.
Set the condition (e.g., equals to "Red").
Step 4: Extract Data
Inside the If yes branch of Condition, add action to extract data.
Add Compose action to prepare email content using dynamic content from the item.
Step 5: Send Email Notifications
Inside the If yes branch, add Send an email (V2) from the Outlook connector.
Configure:
To: Email recipient.
Subject: "Red Formatted Cells Detected".
Body: Use dynamic content and Compose output.
Summary
This workflow will monitor your SharePoint list for items flagged (indicating red-formatted cells), extract relevant details, and send email notifications. Implementing this guide step-by-step will help automate your process efficiently.
Follow each of these steps in Power Automate, ensuring to double-check dynamic content and conditions based on your list's specifics.
Part 9: Implementing the Filter Condition in Power Automate
In this section, you will implement a filter condition in Power Automate to monitor a SharePoint list. The criteria involve the following conditions:
HSSE Risk level must be either 'High' or 'Medium'.
Avetta Compliance Status must be either 'Red' or 'Amber'.
Steps
Create an Automated Flow:
Trigger: "When an item is created or modified" in the SharePoint list.
Add a Condition:
Navigate to the "New step" and choose the "Condition" action.
Here is the filter condition in Power Automate Format:
((HSSE_x0020_Risk eq 'High' or HSSE_x0020_Risk eq 'Medium')) and ((AvettaComplianceStatus eq 'Red' or AvettaComplianceStatus eq 'Amber'))
Implementing the Condition:
Add the first "Or" condition for HSSE_x0020_Risk:
Left side: Choose HSSE_x0020_Risk from Dynamic content.
Operator: equals.
Right side: Enter High.
Click on + Add.
Left side: Choose HSSE_x0020_Risk again.
Operator: equals.
Right side: Enter Medium.
Add the second "Or" condition for AvettaComplianceStatus:
Left side: Choose AvettaComplianceStatus from Dynamic content.
Operator: equals.
Right side: Enter Red.
Click on + Add.
Left side: Choose AvettaComplianceStatus again.
Operator: equals.
Right side: Enter Amber.
Group Conditions:
Group the first two conditions (HSSE_x0020_Risk) using the "Or" operator.
Group the second two conditions (AvettaComplianceStatus) using the "Or" operator.
Finally, group these two sets using the "And" operator.
Email Notification:
If the condition is true:
Action: Send an email.
Specify the recipient, subject, and body in the email.
Below is the schematic representation in the condition builder in Power Automate:
Condition Action:
(
(HSSE_x0020_Risk eq 'High' or HSSE_x0020_Risk eq 'Medium')
and
(AvettaComplianceStatus eq 'Red' or AvettaComplianceStatus eq 'Amber')
)
If true:
- Send an email with the respective details.
Implementation
Insert the described conditions as shown in Power Automate's interface to filter items based on the criteria:
Select condition logic:
Logic split:
Group 1: (HSSE_x0020_Risk eq 'High' or HSSE_x0020_Risk eq 'Medium')
Group 2: (AvettaComplianceStatus eq 'Red' or AvettaComplianceStatus eq 'Amber')
Final Grouping:
Final grouping using "And" operator for the above groups.
Email Notification Action:
If group 1 and group 2 are true, execute the "Send an email" action.
This detailed step ensures the workflow in Power Automate is correctly configured to monitor the specific SharePoint list conditions and send out an email notification when the criteria match.
Power Automate Workflow for Filtering Red-Formatted Cells
Objective
Create a Power Automate flow that retrieves items from a SharePoint list where any cell is formatted with the color #FF0000 (red) and sends an email notification with the relevant data.
Implementation Steps
Trigger:
Use the Recurrence trigger to periodically check the SharePoint list.
Set the interval according to your needs (e.g., daily, weekly).
Get Items from SharePoint:
Use the Get items action to retrieve all items from the target SharePoint list.
Initialize a Red Items Array:
Use Initialize variable to create an array variable (e.g., RedItemsArray) that will hold the items with red-formatted cells.
Apply to Each Item:
Add an Apply to each action to loop through each item retrieved from the SharePoint list.
Check for Red-Formatted Cells:
Inside the loop, use a Condition to check if any column in the current item is formatted with #FF0000.
Unfortunately, Power Automate does not natively support checking cell formatting directly, so this functionality typically requires custom columns in SharePoint that signal when a cell is formatted red.
Assuming there is a status column (StatusColor) in your SharePoint that indicates the cell color:
If `StatusColor` is equal to `#FF0000`
If matched, use the Append to array variable action to add the item to the RedItemsArray.
Send Email Notification:
After the loop concludes, add a Condition to check if the RedItemsArray contains any items.
If true, use the Send an email (V2) action to send an email notification with the details of the red-formatted cells.
Sample JSON Structures
By using a custom column StatusColor that flags red cells in SharePoint, the sample pseudocode implementation inside Power Automate will look like this:
Recurrence Trigger:
Frequency: Daily
Get items:
Site Address:
List Name:
Initialize Variable:
Name: RedItemsArray
Type: Array
Value: []
Apply to each:
From: value (output from Get items)
Actions:
Condition:
Condition: @equals(items('Apply_to_each')?['StatusColor'], '#FF0000')
If true:
Append to array variable:
Name: RedItemsArray
Value: items('Apply_to_each')
Condition:
Condition: @not(empty(variables('RedItemsArray')))
If true:
Send an email (V2):
To:
Subject: Items with Red-Formatted Cells
Body: |
The following items contain red-formatted cells:
@{variables('RedItemsArray')}
Explanation
Trigger: Defines when the flow runs.
Get items: Retrieves all items from the SharePoint list.
Initialize Variable: Prepares an array to hold items with red-formatted cells.
Apply to each: Iterates through each item.
Condition: Checks for red formatting in a designated 'StatusColor' column.
Append to array variable: Adds the item to the array if it meets the condition.
Condition: Verifies if the array contains any items.
Send an email (V2): Sends an email listing all items with red-formatted cells.
You can now apply this Power Automate flow to monitor and handle your SharePoint list data accordingly.
Power Automate Workflow for Monitoring Red-Formatted Cells in SharePoint Lists
Step 1: Create a Flow in Power Automate
Go to Power Automate (flow.microsoft.com).
Click on Create and choose Automated flow.
Name your flow and select the When an item is created or modified trigger.
Select the SharePoint site address and list name.
Step 2: Initialize Variables
Add a new Initialize variable action.
Name: redCellsExist
Type: Boolean
Value: false
Step 3: Get List Item Details
Add a Get item action.
Site Address: Select your SharePoint site.
List Name: Select your SharePoint list.
Id: ID
Step 4: Parse HTML Content to Check Cell Formatting
Replace MultiLineTextField with the actual field name containing your formatted content.
Add a Parse HTML step (since Power Automate doesn't have built-in HTML parsing, you might consider using an Azure Function or another service here).
Azure Function (Pseudocode):
function run(req) {
let itemContent = req.body.content;
// Regex to detect red cells
let redCellPattern = /style="[^"]*background-color:\s*red[^"]*"/i;
return {
status: 200,
body: redCellPattern.test(itemContent)
};
}
Step 5: Set Variable Based on HTML Parsing Result
Add an HTTP request action to call the Azure Function.
Under the if yes branch, add a Send an email (V2) action.
To: Specify recipient emails.
Subject: Red Cells Found in SharePoint List
Body: Describe the issue and include relevant details.
Step 7: Save and Test
Save the workflow.
Test the flow by creating or modifying an item in the SharePoint list that includes red-formatted cells.
Verify that the email notification is sent when red cells are detected.
Conclusion
This workflow leverages Power Automate in combination with an external Azure Function for HTML parsing to monitor SharePoint list items for cells formatted in red and send email notifications accordingly.
12. Add a Compose Action in Power Automate
In this step, we will instruct Power Automate to use the content of a specific field from a SharePoint list item. This content is typically stored in a "MultiLineTextField" in a SharePoint list.
Implementation:
Create a Compose Action
In your Power Automate flow, add a new action by clicking on the "+ New step" button.
Search for "Compose" and select the "Compose - Data Operations" action.
Configure the Compose Action
In the "Compose" action, you need to provide the input data. You will pull this data from the output of a previous step where you retrieved the SharePoint item. Let’s say, the step to get the SharePoint item is named "Get_item".
Replace MultiLineTextField with the actual field name from your SharePoint list. For example, if the field containing the formatted content is named Description, you should use it like this:
Outputs('Get_item'): This refers to the output of a previous action named "Get_item".
['body']: This accesses the body of the response from the "Get_item" action.
['Description']: This accesses a specific field within the body called Description. Replace Description with the appropriate field name from your SharePoint list that contains the multi-line text or formatted content.
Application in Real Life:
Ensure your SharePoint list has a field that can store the content you need to work with in the flow.
Retrieve the SharePoint list item in a previous step within your Power Automate flow.
Use the configured "Compose" action as shown above to extract this specific field's content.
You can now use this content in subsequent steps of your Power Automate workflow, such as sending an email notification.
Following the above steps will allow you to dynamically pull the field content from your SharePoint list and use it within your Power Automate flow efficiently.
Part 13: Extracting Red Formatted Cells in Power Automate
Step 1: Create a Flow to Monitor SharePoint Lists
Trigger: Use the "For a selected row" action or a "Recurrence" trigger depending on your preferred scheduling.
Step 2: Get the Items from SharePoint List
Action: Add "Get items" action from SharePoint.
Site Address: <Your SharePoint Site>
List Name: <Your List Name>
Step 3: Initialize Variables
Action: "Initialize variable" to store the extracted red-formatted cell data.
Name: RedFormattedCells
Type: Array
Value: []
Step 4: Loop Through Each Item
Action: Add "Apply to each" action.
Input: Value from the output of "Get items" action.
"Apply_to_each": {
"type": "foreach",
"inputs": "Value from Get items"
}
Step 5: Process Each Column
Action: Inside the loop, use the "Get item" action to fetch detailed data for the current item.
Site Address: <Your Site Address>
List Name: <Your List Name>
Id: ID from current item.
Action: Add "Compose" action to evaluate each column's cell formatting. Use an expression or script if necessary to determine the cell's format.
This completes the flow to monitor SharePoint lists for red-formatted cells, extract relevant data, and send email notifications.
7. Save and Test: Save your flow and test it to ensure it works as expected.
This setup ensures that the Power Automate workflow will accurately extract red-formatted cells from all columns in the spreadsheet present in a SharePoint list and send relevant notifications.
Full Path in Power Automate
In Power Automate, the "Full Path" refers to the complete hierarchical path to a specific file or list item in a SharePoint site. This can be particularly useful when you need to identify or manipulate items in a SharePoint document library or list.
Practical Example: Monitoring SharePoint Lists for Red-Formatted Cells, Extracting Relevant Data, and Sending Email Notifications
Step-by-Step Implementation
Step 1: Setup the Trigger for Monitoring SharePoint Lists
Create a new flow.
Choose the trigger: "When an item or file is modified" from SharePoint.
Site Address: Select your SharePoint site.
Library Name: Choose the relevant list or document library you want to monitor.
Step 2: Retrieve the Full Path of the Modified Item
Initialize Variables:
Add an action: "Initialize variable".
Name: FullPath
Type: String
Value: triggerOutputs()?['body/{Path}']
Step 3: Get the List Item or File Properties
Add a new action: "Get file metadata" or "Get item"
Site Address: Same as above
File Identifier / Item ID: Use the identifier from the trigger action.
Add another action: "Get file properties" if you selected "Get file metadata".
Site Address: Same as above
Library Name: Same as above
File Identifier: Use the identifier from the previous action.
Replace FieldNameRedFormattedCell with the actual field name you are monitoring for red formatting.
Condition Action:
To check if the cell is red-formatted based on your criteria.
If the condition is met, proceed to the next step.
Step 5: Send Email Notifications
Add an action: "Send an email (V2)"
To: Recipient@example.com
Subject: Alert: Red-Formatted Cell Detected
Body:
Dear User,
A red-formatted cell was detected in your monitored SharePoint list.
Full Path: @{variables('FullPath')}
Relevant Data: @{outputs('Compose_Data')}
Regards,
Power Automate Bot
Testing the Flow
Once the workflow is built, modify an item or file in the SharePoint list with a red-formatted cell. Wait for the flow to trigger and verify that the email notification is sent with the correct details.
Conclusion
By leveraging the "Full Path" in your Power Automate workflow, you can efficiently monitor specific elements in SharePoint, extract necessary data, and ensure relevant stakeholders are promptly notified. This facilitates better data management and enhances collaborative efforts across teams.
Guide to Building a Power Automate Workflow for Monitoring SharePoint Lists for Red-Formatted Cells, Extracting Relevant Data, and Sending Email Notifications
Unit 15: Uploading Documents or Snippets for Analysis
Creating a Flow in Power Automate
Follow these steps to create and execute a flow that allows users to upload documents or snippets to SharePoint, which can then be analyzed and used to send email notifications.
Step 1: Create a New Flow
Navigate to Power Automate.
Click on "Create" and choose "Automated flow."
Step 2: Select a Trigger
Select the "When a file is created (properties only)" trigger from SharePoint.
Configure the trigger to target your specific SharePoint library where documents or snippets are uploaded.
Step 3: Retrieve File Content and Metadata
Add a new step, choose "Get file content," and configure it with:
Site Address: Your SharePoint site URL.
File Identifier: Use the dynamic content from the trigger step.
Add another step, choose "Get file metadata," and configure it with:
Site Address: Your SharePoint site URL.
File Identifier: Use the dynamic content from the trigger step.
Step 4: Analyze Document Content
To implement custom analysis, add a "Condition" or a combination of "Compose" and "Expression" actions, depending on the specifics of your analysis requirements. For instance:
Add a "Compose" action that might use a pre-defined JSON schema or specific expressions to parse the content.
Body: Include the content of the "RelevantData" variable.
Example Email Body
Hello,
The following red-formatted cells were detected in the uploaded document:
@{body('Append_to_array_variable')}
Best regards, SharePoint Workflow Team
Conclusion
This flow will monitor for newly-uploaded documents in SharePoint, analyze them for red-formatted cells, extract relevant data, and send email notifications. Modify the flow steps to suit your specific project requirements and data format rules.
Part 15: Building a Power Automate Workflow for Monitoring SharePoint Lists
Objective
To create a Power Automate workflow that monitors a SharePoint list for red-formatted cells, extracts relevant data, and sends email notifications.
Implementation
Step 1: Create a Flow in Power Automate
Log in to Power Automate.
Create a new Automated Flow using the "When an item is created or modified" trigger for the SharePoint list you want to monitor.
Step 2: Configure the Trigger
Set up the SharePoint Site and List.
Site Address: [Your SharePoint Site URL]
List Name: [Your List Name]
Step 3: Initialize Variables
Add an "Initialize Variable" action to store the necessary data.
Name: formattedCell
Type: String
Value: ''
Step 4: Get List Item Data
Add a "Get item" action to retrieve the item details when a change is detected.
Site Address: [Your SharePoint Site URL]
List Name: [Your List Name]
Id: [ID from the Trigger]
Step 5: Apply Conditional Logic to Check Formatting
Add a "Condition" action.
Under "Choose a value", select the relevant cell.
Use the expression to determine if the cell is red.
contains(triggerBody()?['ColumnName'], '')
On "Yes" branch, update the variable with relevant data.
Set variable: formattedCell
Value: [Data you want to extract, e.g., triggerBody()?['ColumnName']]
Step 6: Send an Email Notification
Add a "Send an email (V2)" action.
Set up your email parameters:
To: [Recipient Email Address]
Subject: "Alert: Red-Formatted Cell in SharePoint List"
Body: "A cell in the SharePoint list has been formatted red. Details: Variable formattedCell"
Step 7: Save and Test the Flow
Save your flow and make some changes to your SharePoint list to trigger the flow and ensure it’s working as expected.
NB: Existing Content
Ensure not to duplicate any unit already covered in your project. This provided workflow focuses strictly on monitoring red-formatted cells and sending email notifications as outlined in Part 15.
By following this detailed guide, you should be able to implement a Power Automate workflow that effectively monitors a SharePoint list for red-formatted cells, extracts relevant data, and sends email notifications when such a cell is detected.