Archive

Monthly Archives: March 2017

Flow is great, and just being able to point and click to build integrations is the thing that makes it so usable. But sometimes you want to be a little bit cleverer with your data and even use functions that remodel the data.

For example, when creating a new Customer within Dynamics 365 for Operations through Flow when a new Account is created in the Common Data Service, if you are like me, then maybe you will want to have a consistent naming convention, and you don’t want to use the standard Account ID that is created in the entity.

My customer naming convention is the first two letters of the Organization Name and then 4 digits, but I cannot change the default numbering format for the Account Id in the Accounts entity.

If I were doing this through Excel, then I would use this formula: 

Upper(Left(OrganizationName)) & Right(AccountId,4)

But how do you do this in Flow?

The good news is that there is a special Data Operations service within Flow that allows you to create a function using data from the previous steps in the flow, and then you can use the output in subsequent steps.

Here is how you do it.

How to do it…

To start off open Flow and then create a new Flow by clicking on the + Create from blank link.

When the trigger event is displayed, search for the Common Data Service actions and select the When a record is created trigger event.

This will then create a trigger for you that needs to be configured.

Click on the The database dropdown list and select the default database.

Then click on the The entity dropdown list and select the Account entity from the list.

Now that we have the trigger which will fire when a new Account is created within the Common Data Service we want to add a step that will create our new account name from the data. To do this, click on the + New Step button and then select the Add an action button.

When the action browser is opened, search for the Data Operations service and then select the Compose action.

This will open a simple action that just has an Input field. This is where we need to create our function that will create our new Customer Number.

The function will be written in the Azure Workflow Definition Language and if you want to find all the documentation on it then here is the link:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

To create the new customer number that is the first two letters of the Organization Name and the last 4 digits of the Account Id (since this is a sequential number) then just paste in this function:

“@concat(toUpper(substring(triggerBody()[‘OrganizationName’],1,2)),substring(triggerBody()[‘AccountId’], sub(length(triggerBody()[‘AccountId’]),4), 4))”

After you have done that just give the Flow a Flow name and then click on the Create flow button.

After the record has been published then you will see that the Account ID is created for the Account.

When you return to you Flow you will see that is has been triggered and if you expand out the Compose action then the Output is now set to the format that we want for our Customer Numbers.

Summary

Now that we have composed our new field we can now use it in future steps within the Flow. For example if you continue on and add another action that created the Customer within Dynamics 365 for Operations, but when populating the Customer Number field, we can now use the output of the Compose action.

How cool is that? (Rhetorical question)

Power BI is a great tool for visualizing your data from Dynamics 365, but wouldn’t it be great if all of your reports and dashboards that you create were embedded directly into your dashboards. Don’t fret, you can do this without writing a single line of code.

Let’s see how to do this and how it works.

Topics Covered

  • Enabling Power BI
  • Adding Power BI Dashboards as Sales Dashboards
  • Drilling through the Data within Power BI

Enabling Power BI

Before we start adding Power BI to our dashboards within Dynamics 365 for Sales we need to first make sure that it is enabled.

How to do it…

To do this, start off by opening the Dynamics 365 for Sales app.

Then click on the Sales tile in the header and click on the Settings tile. Then click on the Administration menu item within the System menu group.

When the Administration page is shown, click on the System Settings menu link.

This will open the System Settings options panel. Click on the Reporting tab within the options and you will be able to see an option called Allow Power BI visualization embedding.

All you need to do here is make sure that this is set to Yes.

After you have turned on Power BI then you can exit out of the options.

Adding Power BI Dashboards as Sales Dashboards

Now that Power BI is enabled, you can start adding Power BI visualizations directly within Dynamics 365 for Sales as their own embedded dashboards.

How to do it…

To do this, all you need to do is open the main Sales Dashboards by clicking on the Sales button in the menu bar and then click on the Dashboards menu item within the My Work menu group.

To add a Power BI Dashboard, just click on the New menu item and then select the Power BI Dashboard menu item.

This will open the Add Power BI Dashboard dialog box and if you click on the Dashboard dropdown list then you will see that all of the dashboards that you have access to within Power BI will show in the list.

All you need to do here is select the dashboard that you want to use as a dashboard and then click on the Save button.

After you have done that you will see the dashboard is now embedded within Dynamics 365 for Sales as one of your personal Dashboards.

Drilling through the Data within Power BI

Now that that you have Power BI dashboards embedded directly within the dashboards, let’s see what you can do with the data that is there.

This will take you over to Power BI Online.

But there’s more. If you click on the in the top right of the Power BI Workspace, then you will see an option that allows you to Analyze in Excel.

If you click on this, you will be taken over to Excel and all the data that you had within the Power BI workspace will be available as a Pivot Table.

If you want to be a little retro, then you can then create your very own analysis through Excel using the same data that you have within Power BI.

Summary

Power BI is a great reporting tool to take advantage, and as you can see it’s super easy to get the dashboards embedded directly within Dynamics 365 for Sales and then act upon it right from there.

All you need to do now is create the dashboards that you want to include and then start embedding them.