web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamix Academy / PowerApps and Microsoft Flo...

PowerApps and Microsoft Flow with Dynamics 365

Abhishek Dhoriya Profile Picture Abhishek Dhoriya 1,013

This article walks through the overview of PowerApps, Microsoft Flow, Common Data Service with Dynamics 365 which will explain what is PowerApps, Microsoft Flow, Common Data Service in connection with Microsoft Dynamics 365, how to connect with data and services as part of PowerApps and Microsoft Flow with Dynamics 365.

Overview of PowerApps, Microsoft Flow and Common Data Service

PowerApps Overview:

  • PowerApps can be used to build mobile and web apps by Visual designer to compose pages.
  • Connect to services using the data.
  • Shared with internal users or organization wide. After building the App publish, or can preview the App before publishing.

PowerApps Life Cycle:

Visual Design -> Save & Publish -> Share -> Run App

PowerApps Core Concepts:

Screens – Where the pages are added for the application and forms are configured.

Expressions – Where the events of the App are customized.

Controls – Where buttons/icons/Gallery/Forms/Media are used.

Microsoft Flow Overview:

  • It is a process automation that spans systems which is developed using Visual designer.
  • Connection can be made to services to access data.
  • Flow is built on top of Microsoft Azure Logic Apps.
  • It can be on demand from PowerApps or can be triggered by an event.

Microsoft Flow Scenarios:

  • Productivity – Auto-archive email attachments about a product to a SharePoint Document Library by D365 account code.
  • Sales – Follow up on new leads created in Dynamics 365 by sending sales literature from SharePoint.
  • Operations – Connect a PowerApp from Operations to a legacy system that requires a cloud orchestration.
  • Information Technology – Notify the current on call and important issues on live-site metrics.
  • Marketing – Collect social media information and create appropriate records in Dynamics 365.
  • Human Resources – Vacation requests from SharePoint to Field Service module to remove from being bookable resource.

Common Data Service Overview:

  • Scalable cloud data store with standard schema through a set of standardized entities.
  • The Common Data Model is extending with custom entities and attributes.

Common Data Service Scenarios:

  • Store customer profile information collected for Dynamics 365 customers.
  • Storage of PowerApps app state information that there aren’t fields for in Dynamics 365.
  • Trade show event collection data of additional data on leads.
  • Storage of sales coaching ideas for use with a Sales coaching PowerApp.

Connecting Power Apps to Dynamics 365

Objectives:

  • Connections.
  • How to use connections.
  • Gallery, form loads.

Connections overview:

  • Connections allow PowerApps and Microsoft Flow to use data and services of different source systems.
  • They can also connect to custom APIs built by developers.
  • Once connected, various connections can be used by multiple PowerApps and flows.
  • Connections are shared with apps, but users sign in with their own credentials and the security will be applied according to the user’s security in the system.

Adding a connection from the app:

Connections can be configured in both PowerApps Desktop Studio and PowerApps web.

In PowerApps Desktop Studio, navigate to Data Sources and select connections/ Add connection and select from the list of available connections or add a new connection from different systems.

In PowerApps web, navigate to Connections on the site map and select the connection and enter credentials to connect to the data source.

Selecting an Instance:

  • Connection is to the tenant not to the organization instance.
  • When added to app, choose an instance.
  • You can configure entities from multiple instances within a tenant and each entity will be a single data source.

Selecting Entities:

  • PowerApp can be configured with one or more Dynamics 365 entities.
  • Entities can be added/removed any time.
  • Remove and re-add to change instance.
  • Refresh after metadata changes.

Each table selected would be listed as a single data source and can be refreshed/removed at any point of time.

Gallery, form loads:

Click on a new project and add different pages where gallery can be put in place by selecting the appropriate data source. Then in the gallery put the forms.

Forms can be edit/display and used accordingly.

Edit forms can be used as a user input/edit forms where user can actually modify the data whereas the display forms are just for displaying the data to the end users.

Icons can be placed on pages and can be used for events where expressions are configured to handle the events like Navigate, Submitform, back etc.

Key functions for working with sets of data:

  • Filter – Apply a filter in the expression to retrieve filtered records.
  • Search – Allows you to search for a single string in one or more data sources.
  • Lookup – Finds the first found record of the filter data.
  • Sort – Sorts the data accordingly.

Filtering Data:

  • Filter: Applies to each record and can include <><<>>=>=<=&&||.
  • Search: Search for a single text value in one or more columns.
  • Lookup: Find a single record and reduce it to all columns or a single value.
  • Sort: Sort can sort by a simple formula.

D365 query option delegation:

Supported queries for delegation to server processing are <>>=<= && || sort.

First 500 records will be processed by the server when the query option is not available and the rest of the records are processed by the client.

Getting Metadata:

Use DataSourceInfor for getting the metadata.

Allows avoiding hard coding of labels.

Functions for working with forms:

  • SubmitForm – causes save to happen on new/changed data.
  • NewForm – sets a form up for creating a new record.
  • EditForm – sets the form into edit mode.
  • ResetForm – reset the form into initial mode.

Updating with a Patch: Update one or more records in a single to using the Patch function.

PowerApps Common Tasks

Working with option sets:

Option set labels are not returned by the connectors but can be resolved using a static internal table and lookup.

Showing totals: Using Concatenate function but the problem here is we can get the total number of records in only for 500 more than that the count will not be accurate.

Changing colors in PowerApps: is by using the Themes.

Limitations:

  • Modified On and Created/ Modified By are not available for use.
  • The user roles are not available for evaluation.
  • Permission Discovery: e.g. Can a user delete a record is not implemented for the Dynamics 365 Connector?


Microsoft Flow and Dynamics 365

Overview:

  • Overview of Microsoft Flow.
  • Understand how to connect to Dynamics 365.
  • Explore scenarios for using with Dynamics 365.
  • Understand the relationship between the flow and logic apps.

Microsoft Flow Overview:

  • It is designed to automate tasks across services.
  • Make use of the UI rich Visual web designer for building Flows.
  • We can either start from Blank flow, or from a pre-built template.
  • Connect to Dynamics 365 by connector for accessing data.
  • It can be triggered by events or on demand.

Flow Core Concepts:

Microsoft Flow-> Trigger-> Condition-> Actions

  • Apply for each – The logic will be applied for each and every record.
  • Do until – the operation finishes
  • Compose string – Hard coded string can be stored in the settings.
  • Stored string can be used multiple times wherever required.

Understand how to connect to Dynamics 365:

Connect to the Dynamics 365 by entering the user credentials and then select the organizations and start from the blank template or by making use of the predefined templates from Microsoft.

Put a trigger point in D365 like when the record is created/updated/deleted and then apply the conditions and then the actions to be taken after the condition is met.

PowerApps and Microsoft Flow with Dynamics 365 together add highly scalable solutions to the organization’s business which will address most of the business requirements.

Explore scenarios for using with Dynamics 365:

Dynamics 365 Triggers:

  • Trigger on Create, Update or Delete from D365 CE.
  • Entity Change Tracking must be enabled to make use of the D365 CE Entities in Flow.

Other Common Trigger Patterns:

Button PowerApps Schedule Developer Requests Office 365 Email SharePoint CDS Facebook/Twitter.

Dynamics 365 Actions –

Customer Engagement Apps:

  • Create, List, Delete, Get, Update.
  • Operations Apps: Create, List, Delete, Get, Update, Get List of entities.
  • Financials Apps: Create, List, Delete, Get, Update, get item types.

We can even have an option to resubmit the flow and the flow runs again without the event being occurred and this actually can be used for debugging the Flow.

Calling Flow from PowerApps:

  • Trigger Flow by configuring a button in PowerApps.
  • Parameters can be passed from PowerApps to flow.
  • Offloads processing to run in the background.

Flow is visible to PowerApps via Actions-> Flows.

Flow can be triggered from action with in the app.

Parameters can be pulled form screen input controls.

Calling Flow from Button:

  • Trigger a flow from button using the mobile application.
  • Text input parameters can be added to fill in the data on fly.
  • Use button trigger tokens to populate user, location and time info.

Button Trigger tokens – latitude, longitude, fullname, address etc.

Understand the relationship between the flow and logic apps:

Logic App and Flow interact using the HTTP cards let you call from one to another.

Logic Apps and Flow:

  • Flow is actually built on top of Logic Apps and leverages the same workflow visual designer. 
  • Connectors that work in one, can also work in another.
Microsoft Flow Logic Apps
Targeted to office &
business users
Targeted to IT Pros, developers
Good for self-service
scenarios
Good for mission critical scenarios
Ad-hoc develop in Production Source Control, Testing and Azure Resource Management Support

Common Data Service

Objectives:

The Common Data Service provides a scalable, secure, compliant data store to enable rapid application development.  A key component of the service is the Common Data Model that provides the predefined schema for the most common data used in business applications.  Data from other systems including Dynamics 365 apps can be synchronized into the Common Data Service. 

Common Data Service:

  • An entity model is used to represent business data and relationships.
  • Each environment can have one database.
  • Each database gets the standard entities – the Common Data Model.
  • Role based security is used to control data usage.

Common Data Service Usage Scenarios:

Planned Scenarios Not Planned Scenarios
Pulling data from other systems to work on consolidated data Replacement for Dynamics 365 database
New purpose built application with PowerApps/Flow that store data in standard and custom entities Use as a data warehouse

Common Data Model Categories:

  • Foundation – Business Unit, Cost Center, Product.
  • Person – Person, Contact, Fan, Tenant.
  • Group – Team, Household, Family.
  • Organization.
  • Purchase – Vendor, Purchase Order.
  • Sales – Account, Partner, Sales Invoice.
  • Customer Service – Case, KB Article, Case Activity.

Synchronizing data with the Common Data Service:

Now Future
Currently there is no automatic synchronization Current techniques of Connectors and lookup fields will continue to work
Flow could be used to push the data Automatic Synchronization is being developed.
Guid fields can be used as pointers to Dynamics 365 data Pro SDK will also be available to use for more custom scenarios

Working with Entities:

By default, there would be 65 entities when the database gets created.

The Name of the existing entities cannot be modified to ensure the consistency. Existing fields cannot be modified but new fields can be added to the existing entities.

Can create N:1 relationship on new and existing entities.

Unlike D365, whenever an entity is created in CDS, the Primary ID will be the Auto Number which will help to identify the record and here in CDS, the Modified By and Created By will be Text fields.

New data type fields in CDS are Address, GUID, Auto Number, Person Name, Website URL.

Currently only N:1 relationship can be created between the Entities in CDS.

Field Groups:

One area related to fields that is a little bit unique from what we have in Dynamics 365 is the concept of field groups.  It allows for the grouping of one or more fields into a set of fields or a field group to allow to speed up the application creation and maintenance.  So field groups are shared across applications that use the entity.  The idea behind field groups is on the visual side. Once that field group has been defined, instead of individually putting the individual fields on the visual canvas that you’re building, the screen, you would simply put the field group, bringing that whole set of fields along together as it was defined in the field group.  This helps promote consistency.  It also makes it easier to maintain the application because when a change is made in the future to that field group, it is reflected in all the applications that use that field group. 

Understanding Security:

  • Role model security model with authorization at the entity level.
  • Users or groups can be assigned security roles.
  • Roles relate to permission sets.
  • Permission sets define access to one or more entities.
  • Users with multiple roles get the accumulated permissions.

PowerApps and Microsoft Flow with Dynamics 365 are a highly scalable solutions to address the requirements of various businesses in today’s world.

Useful Resources:

Find us on:

The post PowerApps and Microsoft Flow with Dynamics 365 appeared first on Dynamix Academy.

Comments

*This post is locked for comments