Creating Activities using Power Automate Flows now possible!

By | February 3, 2020

Introduction

Power Automate is the next big thing for Microsoft as it helps to perform automated actions and operations without requiring pro-dev capabilities. The power of the flow however, depends on how comprehensive the connectors are.

Microsoft has been working to enhance its connectors for Dynamics 365 CRM. This journey started with the release of Dynamics 365 CRM Connector which is now deprecated and can no longer be used.

How to Create Activities using Power Automate Flows

Then came the Common Data Service Connector. This connector was way advanced than the Dynamics 365 CRM connector and we were allowed to perform CRUD Operations on CDS entities.

How to Create Activities using Power Automate Flows

But the CDS connector only supports setting of the following properties for activity entities:

How to Create Activities using Power Automate Flows

One of the limitations of the CDS connector while creating activities was the inability to provide activity parties which made it impossible to use the connector for creating activities without any pro-dev expertise.

The most recent version of CDS connector is the Common Data Service (Current) connector. It is this connector that you should be using moving forward on all of your projects. Also, it would be a good idea to update your old flows that references either of the older connectors to this one.

Note: Common Data Service (Current) connector will ALWAYS connect to the environment within which the flow is being executed.

This connector is available only when a flow is created from within the context of a solution.

How to Create Activities using Power Automate Flows

And it supports the following additional actions:

How to Create Activities using Power Automate Flows

When you try to create an email record using this connector, you will be presented with the following screen:

How to Create Activities using Power Automate Flows

Apart from the fields on the email entity, you now have the ability to provide the activity parties associated with the activity.

Activity Parties refer to To, From, CC, BCC, Required Resources, Optional Resources and similar attributes that are available only on the activity type of entities.

How to Create Activities using Power Automate Flows

To set the value, you need to provide the reference to the related lookup object.

For User, it would be:

/systemusers(<guid>)

For contacts, it would be:

/contacts(<guid>)

In general, it would be:

/entityname(<guid>)

Here is a complete screenshot of the entire flow for better context to the screenshot shared above:

How to Create Activities using Power Automate Flows

Conclusion

With flow now supporting activities, it opens up opportunities to create activities through Canvas Apps with the help of flows.

Free 70% of storage space in CRM with Attachment Management Apps!

Attach2Dynamics – Store and manage documents/attachments in cloud storage of your choice – SharePoint, Dropbox or Azure Blob Storage from within Dynamics 365 CRM.
SharePoint Security Sync – Robust and secure solution to integrate Dynamics 365 CRM and SharePoint Security Sync thereby ensuring secure access to confidential documents stored in SharePoint.

17 thoughts on “Creating Activities using Power Automate Flows now possible!

  1. SWAROOP S DESHMUKH

    Hello,

    Is there an option to send an email record created using a flow?

    Have you tried it? What is the best way to approach this requirement.

    Thanks,
    Swaroop

    1. Inogic

      Yes, you can send the email record via Power Automate(flow) using Bound Actions. See below Bound Action step’s screen clip. To use this step, you need to create your flow inside solution and use the latest CDS(Current Environment).

      In the below showed action step, you just need to pass GUID of Email record at Item ID.

      Flow

      You can also refer our one of the blog that explains how to execute CRM Actions(Messages) using Power Automate.
      https://www.inogic.com/blog/2019/11/how-to-call-an-action-through-power-automatems-flow/

      Hope this helps.

      Thanks!

  2. MANISH JAIN

    How to use email templates associated to entity in Email Message Creation ?

    1. Inogic

      You can use “Perform an unbound action” of Common Data Service (Current Environment) connector. Use “SendEmailFromTemplate” action from the list.

      Power-Automate-Flow

      Hope this helps.

      Thanks!

      1. Joshua

        Hi Inogic
        I would like to send an Email based on a D365 template from flow. Do you know what to put in the “Target” field?
        I tried to enter: /users(@{triggerBody()?[‘entity’]?[‘_ownerid_value’]}) but I always get the error: enter a valid json

  3. Ryan J

    Another item to add is you need to apply the same rest endpoint logic to the Regarding field /(GUID)

  4. Surendra

    Will it be possible to add multiple users in To/CC recipients.

    1. Inogic

      Yes, it is very much possible to add multiple users in To/CC recipients.

      Similar to the steps mentioned in our blog, after adding an User/Contact to the To recipient you will see an option to add another item as below. Just click on that and follow the same process.

      CC

      CC

      As illustrated in the above screenshot, we wanted to add 2 recipients in the To/CC recipient fields therefore, we added 2 items for the To/CC recipient fields.

      Hope this helps.

      Thanks!

  5. RW

    Is there a way to add multiple “To” entries without having to click the “Add new item” option? I’m trying to send the email to members of a Team so the number of entries will be dynamic. I think I can build a variable however the structure should be, but would need to know if we can put all the information on 1 “To” line.

    1. Inogic

      Hi,

      You can add multiple recipients by initializing the array variable and loop through records and add values in the array variable in the following format:

      entitysetname(guid)

      Step 1: Retrieve records for which we want to send the email – use “List records” to retrieve a list of records that you want to send the email. For example, we have retrieved Contact records.

      Step 2: Initialize Array variable and store array of record’s GUID – Initialize the array variable, and using for loop store the retrieved records in the above step and append GUID’s of each record to the array variable.

      Below is the sample code of the array for the recipients:

      Step 3: Use Array variable in the “Recipient” field while sending email through power automate.

      Hope this helps.

      Thanks!

  6. Katy Milner

    Hi,
    I’m using the same methods as above trying to set the “Organiser” field to the Owner when creating an appointment. Is this possible?
    Thanks in advance
    Katy

    1. Inogic

      Hi,

      Yes, it is possible to set the Organiser field with the Owner field value. As mentioned in the blog, we can set the party list of the Activity entity within the power automate. Since the Organiser on the appointment is the party-list field, we can set the owner using Party List Attribute within Power Automate.

      Please refer below screenshot for the same.

      Hope that helps,
      Thanks!

  7. Jason

    Is it possible to send emails to non-entity based addresses? Ie. could I just specify a string of an email address instead of referencing an entity?

    1. Inogic

      Hi Jason,

      You can send emails to non-entity based addresses using ‘addressused’ parameter. Please refer to our following blog: https://www.inogic.com/blog/2020/09/power-automate-send-an-email-using-the-email-template-part-1/

      In this blog, we have explained how you can send emails using email template as well as how we have sent email to non-entity email address.

      Basically, you would need to use “SendEmailFromTemplate” unbound request and need to pass the target as follows:

      Hope this helps!
      Thanks

  8. Ankur

    Can we send an email without using perform an outbound action ?

    My idea is to play around with the Activity status and Status code of Email Messages record and if it can trigger the email ?

    1. Inogic

      Yes, you can send email using bound action. You can trigger the flow based on status of email message record and send the Email with help of bound action.

      bound-action

      Hope this helps.

      Thanks!

Comments are closed.