Create a Cloud flow to send an email to user on change of record status to inactive

To create a workflow in Dynamics 365 that sends an email to the respective user when an account record's state changes to inactive, you can follow these steps:

1. Navigate to Power Automate (formerly Microsoft Flow)

- Go to your Dynamics 365 environment and access Power Automate. You can find this under the "Automate" or "Power Automate" section in the Dynamics 365 app.

2. Create a New Cloud Flow

- Click on "Create" or "New flow" to start creating a new flow.

3. Choose a Trigger

- Select "Common Data Service" as the trigger connector.
- Choose "When a record is updated" as the trigger event.

4. Set up Trigger Conditions

- Specify the environment, entity name (e.g., Account), and scope (Organization or Business Unit).
- Define the Condition:
  - Attribute: Select "State Code"
  - Operator: Equals
  - Value: Inactive (you may need to specify the exact value based on your Dynamics 365 configuration; typically, it's a number corresponding to "Inactive")

5. Add an Action

- Click on "+ New step" to add an action that sends an email.
- Choose "Office 365 Outlook" or "Send an email (V2)" depending on your preferences and organization's setup.

6. Configure Email Action

- Fill out the necessary fields for the email:
  - To: Use dynamic content to select the owner or user associated with the account record.
  - Subject: Define a meaningful subject line (e.g., "Account Record Inactive Notification").
  - Body: Craft the email message. You can use dynamic content from the trigger to personalize the message with details about the account record.

7. Save and Test the Flow

- Save your flow and give it a descriptive name.
- Test the flow to ensure it triggers correctly when an account record's state changes to inactive. You might need to update a test record to inactive to verify.

8. Activate the Flow

- Once tested successfully, activate the flow to make it operational.

Additional Tips:

- Permissions: Ensure the user creating the flow has adequate permissions to access and modify records in Dynamics 365.
- Error Handling: Consider adding error handling steps in case the email fails to send.
- Monitoring: Monitor the flow's execution history to ensure it runs as expected.

By following these steps, you'll have set up a workflow in Dynamics 365 (Power Automate) that automatically sends an email notification to the respective user when an account record's state changes to inactive. Adjust the specifics according to your organization's email policies and Dynamics 365 configuration.