Hi,
I have 2 tables in Dataverse:
1) Employee
Name
Lastname
EmployeeID
Status
2) Request
EmployeeID
Field1
Field2
Field3
When someone on the table Employee change the status, I need to run a flow that send an email to a mail address containing the fields information in the Request table.
Both tables have the same column and value EmployeeID.
So, I need to create a flow "when a row is updated" in Employee table and lookup for the information on the Request table based on the same EmployeeID column.
How can I achieve that?
Thanks in advance.
To add some more to @sandeepstw 's answer on point no. 2, I recommend using the "Select columns" parameter in the trigger with the logical name of the status column in the Employee table. (because the trigger does not contain the previous status value to compare if the status value has been changed)
To get the Request records using the List rows action, you can use eq condition in the Filter rows parameter.
Hi There,
To achieve the desired functionality where an email is sent to a specified email address when the status of an employee is changed in the Employee table, with the fields information from the corresponding row in the Request table, follow the technical solution below:
1. Create a Power Automate flow: Begin by creating a new flow in Power Automate. Use the "When a row is updated" trigger for the Employee table. This trigger will detect changes in the status column of the Employee table.
2. Add a condition: Within the flow, add a condition action to check if the status column has changed. Configure the condition to compare the previous and current status values. This will ensure that the flow only proceeds if the status has been updated.
3. Retrieve information from the Request table: Inside the condition, add a "Get rows" action to retrieve the corresponding row from the Request table based on the EmployeeID. Use the EmployeeID from the Employee table to filter the rows in the Request table and retrieve the required information.
4. Compose email body: Utilize the "Compose" action to construct the email body. Include the necessary fields and information from the retrieved row in the Request table.
5. Send an email: Add the "Send an email" action to send an email to the desired email address. Configure the email subject, recipient, and include the composed email body from the previous step.
6. Save and test the flow: Save the flow and test it by updating the status column of an employee in the Employee table. Verify if the flow triggers successfully and sends the email with the appropriate fields information from the corresponding row in the Request table.
By following these steps, you can create a Power Automate flow that sends an email with the fields information from the Request table when the status of an employee in the Employee table is updated. Make sure to save and test your flow with various scenarios to ensure it functions as expected.
Please give kudos and mark as solution if it helps.
Thanks,
Sandeep Mishra