Workflow Power Automate -- 2
Budget: €30 – €250 EUR
Purpose of the Flow
The purpose of this flow is to automate the download of offers received in a specific Outlook folder. Additionally, it adds a supplier code to the name of the downloaded file. This supplier code is retrieved from an existing table based on the sender's email address. If the sender is not found in the table, they are automatically added with a new supplier code.
Steps of the Flow
Trigger: When a new email arrives (V3)
This flow is triggered when a new email arrives in a specific Outlook folder.
Initialize Variables
FileName: Temporarily stores the name of the attached file.
NewSupplierCode: Stores a new supplier code if needed.
MaxSupplierCode: Tracks the highest existing supplier code in the table.
Apply to Each Attachment
Loops through each attached file in the email.
Get Attachment Content
Retrieves the content of the email attachment.
Set File Name
Saves the name of the attachment in the FileName variable.
List Table Rows
Retrieves all rows from the suppliers' table in the Proveedores de ofertas.xlsx file in OneDrive.
Find the Maximum Supplier Code Value
Loops through each row in the table to find the highest existing supplier code.
Update the New Supplier Code Value
Updates the NewSupplierCode by adding 1 to the maximum value found.
Filter Supplier Table Information
Filters the table rows to find the row that matches the sender's email address.
Condition: Check if the Supplier Exists
Checks if the supplier already exists in the table.
If True (Supplier Exists):
Initializes the SupplierCode variable with the existing supplier code.
If False (Supplier Does Not Exist):
Increments the NewSupplierCode.
Adds a new row in the suppliers' table with the sender's email address and the new supplier code.
Initializes the SupplierCode variable with the new supplier code.
Rename and Save the Attachment
Concatenates the supplier code with the attachment file name.
Saves the attachment in OneDrive with the new name, including the supplier code.
Flow Functionality Summary
Email Reception:
When an email arrives in a specific folder, the flow is triggered.
Attachment Processing:
Each attached file is processed one by one.
Table Lookup:
The sender's email address is searched in the suppliers' table.
Code Assignment:
If the supplier exists, their code is used; if not, a new supplier code is created.
File Renaming:
The attachment file is renamed to include the supplier code.
File Saving:
The attachment file is saved in a specific location in OneDrive.
Technical Details of the Flow
Trigger: When a new email arrives (V3)
Configured to activate when a new email arrives in a specific folder.
Initialize Variables
FileName: Stores the name of the attached file.
NewSupplierCode: Stores the new supplier code.
MaxSupplierCode: Finds the highest supplier code.
Apply to Each Attachment
Iterates over each email attachment.
Get Attachment Content
Retrieves the content of the attachment.
Set File Name
Stores the attachment name in FileName.
List Table Rows
Retrieves all rows from the suppliers' table in OneDrive.
Find the Maximum Supplier Code Value
Iterates over each table row to find the highest supplier code.
Update the New Supplier Code Value
Updates NewSupplierCode by adding 1 to the highest value found.
Filter Supplier Table Information
Filters the rows to find the one that matches the sender's email.
Condition: Check if the Supplier Exists
Verifies if the sender already exists in the table.
If True (Supplier Exists):
Initializes SupplierCode with the existing code.
If False (Supplier Does Not Exist):
Increments NewSupplierCode.
Adds a new row in the table with the sender's email and the new code.
Initializes SupplierCode with the new code.
Rename and Save the Attachment
Concatenates SupplierCode and FileName to rename the file.
Saves the file in OneDrive with the new name.
Benefits of the Flow
Automation: Eliminates the need to manually process emails and their attachments.
Organization: Ensures all attachments are correctly renamed and stored, facilitating identification and retrieval.
Supplier Management: Keeps an updated table of suppliers, ensuring each has a unique code.
The purpose of this flow is to automate the download of offers received in a specific Outlook folder. Additionally, it adds a supplier code to the name of the downloaded file. This supplier code is retrieved from an existing table based on the sender's email address. If the sender is not found in the table, they are automatically added with a new supplier code.
Steps of the Flow
Trigger: When a new email arrives (V3)
This flow is triggered when a new email arrives in a specific Outlook folder.
Initialize Variables
FileName: Temporarily stores the name of the attached file.
NewSupplierCode: Stores a new supplier code if needed.
MaxSupplierCode: Tracks the highest existing supplier code in the table.
Apply to Each Attachment
Loops through each attached file in the email.
Get Attachment Content
Retrieves the content of the email attachment.
Set File Name
Saves the name of the attachment in the FileName variable.
List Table Rows
Retrieves all rows from the suppliers' table in the Proveedores de ofertas.xlsx file in OneDrive.
Find the Maximum Supplier Code Value
Loops through each row in the table to find the highest existing supplier code.
Update the New Supplier Code Value
Updates the NewSupplierCode by adding 1 to the maximum value found.
Filter Supplier Table Information
Filters the table rows to find the row that matches the sender's email address.
Condition: Check if the Supplier Exists
Checks if the supplier already exists in the table.
If True (Supplier Exists):
Initializes the SupplierCode variable with the existing supplier code.
If False (Supplier Does Not Exist):
Increments the NewSupplierCode.
Adds a new row in the suppliers' table with the sender's email address and the new supplier code.
Initializes the SupplierCode variable with the new supplier code.
Rename and Save the Attachment
Concatenates the supplier code with the attachment file name.
Saves the attachment in OneDrive with the new name, including the supplier code.
Flow Functionality Summary
Email Reception:
When an email arrives in a specific folder, the flow is triggered.
Attachment Processing:
Each attached file is processed one by one.
Table Lookup:
The sender's email address is searched in the suppliers' table.
Code Assignment:
If the supplier exists, their code is used; if not, a new supplier code is created.
File Renaming:
The attachment file is renamed to include the supplier code.
File Saving:
The attachment file is saved in a specific location in OneDrive.
Technical Details of the Flow
Trigger: When a new email arrives (V3)
Configured to activate when a new email arrives in a specific folder.
Initialize Variables
FileName: Stores the name of the attached file.
NewSupplierCode: Stores the new supplier code.
MaxSupplierCode: Finds the highest supplier code.
Apply to Each Attachment
Iterates over each email attachment.
Get Attachment Content
Retrieves the content of the attachment.
Set File Name
Stores the attachment name in FileName.
List Table Rows
Retrieves all rows from the suppliers' table in OneDrive.
Find the Maximum Supplier Code Value
Iterates over each table row to find the highest supplier code.
Update the New Supplier Code Value
Updates NewSupplierCode by adding 1 to the highest value found.
Filter Supplier Table Information
Filters the rows to find the one that matches the sender's email.
Condition: Check if the Supplier Exists
Verifies if the sender already exists in the table.
If True (Supplier Exists):
Initializes SupplierCode with the existing code.
If False (Supplier Does Not Exist):
Increments NewSupplierCode.
Adds a new row in the table with the sender's email and the new code.
Initializes SupplierCode with the new code.
Rename and Save the Attachment
Concatenates SupplierCode and FileName to rename the file.
Saves the file in OneDrive with the new name.
Benefits of the Flow
Automation: Eliminates the need to manually process emails and their attachments.
Organization: Ensures all attachments are correctly renamed and stored, facilitating identification and retrieval.
Supplier Management: Keeps an updated table of suppliers, ensuring each has a unique code.