Search
  • Dynavigate

Working with Dynamics 365 relationships in Flow

Since Microsoft is pushing more functions to Flow you might want to take a look at that "new stuff over there" in Flow and take it for a spin. However some things are really easy to do in workflow, but a pain in Flow, working with relationships can be a pain.

So let's take a look at how you can display some easy data in an email.

The scenario is that you want an email when something happens in Dynamics 365, consider that we create a new entity for this scenario, let's call it "Flow Test" (with schema name dynav_flowtest).

Create it with some fields to test this function on:


entity fields

We have prepared for further challenges for Flow, but for now, we are going to focus on Account and the default fields Owner and Created By.

Then for future reference, I created a simple Workflow that sends me an email:

And that works as expected:

Workflow email result

Then I go and create a Flow based on the Common Data Service connector, it's important that you select the preview one, we will need that for the optionset name:

Then I added an action, and Send an email with Outlook 365.

email version 1

Result version 1:

Name: Flow test

Account: 74b7efab-8af2-e811-a950-000d3ab6488a

Amount: 123456

Created by: c301dce5-782e-4e69-b793-19d501465877

Created on: 2019-02-13T08:30:10Z

Expense type: 192350001

Owner: c301dce5-782e-4e69-b793-19d501465877



Now, this is not very good, every lookup is displaying the internal CRM GUID instead of the name

The Amount is not formatted in any way.

Created on is not formatted nor in my timezone, instead, it's in UTC

Option set displays the internal CRM value instead of the name.


This entry we will focus on fixing the lookup to display names instead of those ugly GUID's.

We start by adding three new actions (one for each lookup we need to get) to the Flow, let's add Get Record from Common Data Service

Get Record in Common Data Service

Configure them like this, and remember to change names:

get record configured

The owner can be both team and user, but let's ignore that, continue to update the send email action:

Note that it's nice to filter the dynamic content, and now it pays off to have good names on the previous "get record" actions.


Email now looks a lot better:

Name: Flow test

Account: test

Amount: 123456

Created by: Markus Erlandsson

Created on: 2019-02-13T08:30:10Z

Expense type: Car Rental

Owner: Markus Erlandsson

14 views

Visiting adress:

 

Dynavigate AB

c/o XLENT

Baltzargatan 25, 2nd floor

211 35 Malmö

Postal adress:

 

Dynavigate AB

c/o Gynnerstedt
Östra Lärkvägen 7
236 42 Höllviken

 

 

Tel:         +46 709 851940

Org.No:   559156-9818