Archive

Archive for the ‘PowerApps’ Category

Canvas App using Dynamics On-premise data

November 19, 2019 Leave a comment

Last week there was a question on my blog to check for the options to build a Canvas App which consumes CRM on-premise data.

To answer this, Power Apps has connectors (CDS and Dynamics 365) to communicate with Dynamics online but there is no built-in Dynamics on-premise connector.

However there are options to connect Canvas app with Dynamics on-premise, which are listed below.

Using ‘Gateway’ to connect to SQL on-premise DB:

  • This option is about connecting to Dynamics SQL DB using on-premises data gateway.
  • The on-premises data gateway acts as a bridge to provide quick and secure data transfer between on-premises data PowerApps.
  • Refer my blog on steps to use gateway and build a Canvas App.
  • Limitation:
    • With ‘Gateway’ option we can only view Dynamics data in PowerApps.
    • There is no way to add or modify Dynamics data using the current PowerApps gateways.

Using ‘KingswaySoft’ connector:

  • KingswaySoft SSIS Integration Toolkit for Dynamics 365 includes components to integrate with CDS.
  • Using the ‘CDS Connection Manager’ we can easily connect and bring data into and out of CDS.
  • Once data is in CDS, we will be able to leverage this data with PowerApps.
  • Any updated data being generated with PowerApps will be reflected in CDS which can then be retrieved and synced with your Dynamics on-premise instance.

Integrate on-premise environment with the CDS:

  • Its the same approach, ‘KingswaySoft’ connector leverages but this option is manual integration.
  • Integrate the on premise environment with the CDS–in effect setting up a hybrid environment, where you have a copy of your configuration in the cloud as well as your on premise CRM, and create a bi-directional integration to synchronize data changes between the two environments.
  • Limitation:
    • There will be potential delay for record changes to synchronize between the On-premise and CDS.

Refer the article for more details.

🙂

 

Power Platform new announcements – Microsoft Power Automate, RPA and more

November 18, 2019 Leave a comment

In Microsoft Ignite 2019, following major updates to the Microsoft Power Platform were announced:

  • Microsoft Flow is being renamed to Microsoft Power Automate, to better align with the Microsoft Power Platform.
  • Robotic process automation (RPA) has been added to Microsoft Power Automate, delivering an end-to-end automation solution that spans AI, APIs, and UI on the Microsoft Power Platform.
  • Microsoft Power Virtual Agents—a no-code/low-code app that allows anyone to create and deploy intelligent AI-powered virtual agents.
    • Refer my blog for Virtual Agents Intro.
  • A host of new security enhancements for Microsoft Power BI, that add industry leading data security capabilities no matter where your analytics data is used and accessed.
  • Tighter integration between the Microsoft Power Platform and Microsoft Teams, bringing the world’s most popular collaboration app and the Power Platform closer together.
  • A new set of prebuilt models for AI Builder that add even more advanced AI models to Microsoft Power Automate and Microsoft Power Apps that are available to everyone.

Refer this link for more details and keynote

🙂

[Step by step] Basic Canvas app using Dynamics 365 as Data Source

November 8, 2019 1 comment

In this article, I am going to provide steps to build a basic Canvas app which uses Dynamics 365 (CDS) as Data Source.

If you are new to Power Apps, refer my blog on steps to get started.

The App we are going to build will have 3 screens.

  • Manage Contacts – Displays the list of Contacts using ‘Gallery’ control.
  • Create Contact – Creates a new Contact.
  • Edit Contact – Updates an existing Contact.

Create a new Canvas app:

  • Connect to the Power Apps portal and select the ‘Environment’.
  • Create a new ‘Canvas app from blank’.

PA_Env3

Connect to Dynamics 365 data source:

Now we have the blank App and as a first step, create a new data source by connecting to your D365 instance using ‘Dynamics 365’ connector.

  • Click on the ‘Data source’ tab.
  • Under the ‘Connectors’, select ‘Dynamics 365’ and choose the ‘dataset’.
    • ‘dataset’ is your Dynamics organization name.

PA_Env4

  • Next, under the ‘Choose a table’ pane, select the entities you would like to work with.
    • I’ve chosen ‘Contacts’ entity for this App

PA_Env5

  • Click on ‘Connect’
  • You should see the ‘Contacts’ table under ‘Data sources’ as below:

PA_Env20

Design ‘Manage Contacts’ screen:

Now we have ‘Data source’ ready and lets design our first screen.

  • By default the Canvas app will have a screen.
  • Rename the out of the box screen to ‘ManageContacts’
    • Providing appropriate name to the controls is a best practice.
  • As we need to display available ‘Contacts’ on the screen, select ‘Insert -> Gallery’ and choose ‘Blank Vertical’.
    • ‘Gallery’ is a grid kind of a control.

PA_Env6

  • Now we need to map ‘Contacts’ table to the Gallery.
  • Select the ‘Gallery’ and click on ‘Edit gallery’ icon.

PA_Env7

  • In the ‘Select a data source’ pane, select ‘Contacts’ table. Now the ‘Gallery’ gets mapped with ‘Contacts’ from Dynamics.

PA_Env8

  • To display the Contact details (i.e., Full Name, Email, etc…), add ‘Label’ controls to the ‘Gallery’ and rename the Labels with meaningful names.
  • Labels will not show anything until you map them with the Contacts field.
  • So, select the Label and in the ‘Text’ property, type ‘ThisItem.{field_Name}
    • To map, ‘Full Name’ of the Contact to a label, set ‘Text’ as ThisItem.’Full Name’

PA_Env9

Design ‘New Contact’ screen:

In the ‘Manage Contacts’ screen, we configured a ‘Gallery’ which displays all the Contacts. Now lets design a ‘New Contact’ screen.

  • Add a ‘New Screen’ and rename it.
  • To Create/Edit records, we need to add ‘Forms’ control
    • ‘Edit’ form: Use this to Create or Edit a record.
    • ‘Display’ form: Use this to display the record (Read-only).
  • So, lets add a new ‘Edit’ form to the screen and rename it to ‘formCreateContact‘.

PA_Env12

  • Next, we need to map the ‘formCreateContact’ to ‘Contacts’ Data source and then select and arrange the ‘Contact’ fields, which allows us to input and save.
    • Set the ‘DataSource’ property of ‘formCreateContact’ to ‘Contacts’
    • Click on the highlighted link and add the required columns and click ‘Add’.

PA_Env13

  • Next, we can rearrange the columns using ‘Move up’ and ‘Move down’ options.

PA_Env14

  • We can also set ‘Columns’ to 1 of the ‘formCreateContact‘ which arranges the fields in a single column.
  • Add ‘Save’ icon to the ‘CreateContact’ screen.

PA_Env16.PNG

  • As we need to save the ‘Contact’ (i.e., Submit the Form) on ‘Save’ icon click, add below statement

SubmitForm(formCreateContact);

Link ‘Manage Contacts’ screen and ‘New Contact’ screen:

Now, we have the ‘New Contact’ screen ready. Lets hook it up to ‘ManageContacts’ screen.

  • Go to ‘ManageContacts’ screen and add + icon.
  • There are 2 key steps to create a new Contact
    • First create a new form of type ‘formCreateContact’.
    • Navigate to ‘New Contact’ screen.
  • We need to execute these key steps on click of + icon.
  • Select the + icon and on the ‘OnSelect’ event, add below statement

    NewForm(formCreateContact);Navigate(CreateContact);

PA_Env15.PNG

  • That’s it, run the App and you should be able to see the Contacts on ‘Manage Contact’ screen.

PA_Preview1.PNG

  • Click on + icon, which will take you to ‘New Contact’ screen.

PA_Preview2

  • Lets see ‘Edit Screen’ and Navigation’s in next article.

🙂

 

Categories: CRM, PowerApps Tags: ,

[PowerApps Portal (preview)] Build your first portal

PowerApps Portalsprovides ability to build low-code, responsive websites which allow external users to interact with the data stored in the Common Data Service.

Refer article for introduction. PowerApps Portals are in Preview now and lets see how to get started with a simple portal.

Perquisites:

Steps to build your first Portal:

  • Login to PowerApps maker Portal
  • Pick the right ‘Environment’. Refer ‘Notes’ section below to know more about ‘Environments’.
  • Click on ‘Portal from blank (preview)’ link.

PAPP_Portal_15

  • In the pop-up, fill ‘Name’, ‘Address’ and ‘Language’ and click ‘Create’.

PAPP_Portal_2

  • Portal provisioning takes time and you will be notified once done.

PAPP_Portal_5

  • Post provisioning, click on ‘Edit’ which will redirect you to Portal editor.

PAPP_Portal_16

  • You get pre configured ‘Home’ page and ‘Child Pages’.
  • To add a new Page,
    • Either click on ‘+New page’ from ribbon
    • Or Right Click , ‘Home’ and add a New Page.

PAPP_Portal_6

  • I have added a new ‘Accounts’ page and filled the details on the right side ‘Component’ panel.
  • To create a new ‘Account’ form, click on ‘Form’ and choose Entity, Form and Mode from the ‘Component’ panel.

PAPP_Portal_8

  • To add a new ‘Entity List’ control, click on ‘List’ and on the right hand side, select ‘Entity’ and ‘Views’
    • Note: In the screen below, I’ve added an existing ‘List’. The properties are same for new ‘List’ as well.

PAPP_Portal_7

  • To map the Account ‘Form’ with ‘List’, set properties as below

PAPP_Portal_9.PNG

  • At any point of time, to view the changes, click on  ‘Browse website’ on top right corner.
  • Home Screen

PAPP_Portal_13.PNG

  • Accounts Screen

PAPP_Portal_14

Notes:

  • To use the Dynamics CE entities, you have to select the CE ‘Environment’ in your maker portal, before the start of Portal creation.
    • A ‘default’ environment gets created by default. If you pick ‘default’ environment, you will need to create a new Environment with CDS database.

PAPP_Portal_17

PAPP_Portal_18

New Environment

  • We can still create Portal from the ‘Dynamics Admin Center’.

PAPP_Portal_3

  • PowerApps portal got ‘.powerappsportals.com’ as domain and regular portal will be of ‘.microsoftportals.com’ domain.

PAPP_Portal_4

  • You can still create/update portal components (i.e., Entity List, Forms, Web Templates) from Dynamics web application.
  • Clear cache using ‘/_service\about‘ is still available in PowerApps portal.

PAPP_Portal_10

🙂

 

 

[Step by Step] Canvas App using on-premise SQL server as Data Source

June 15, 2019 1 comment

In this post, lets see how to build a Canvas App with data from on-premise SQL Server.

Using Gateways ,data can be transferred quickly and securely between a canvas app and an on-premises data source, such as an on-premises SQL Server database or an on-premises SharePoint site.

Lets get started to configure a Gateway and read the on-premises SQL Data which acts as a Canvas App’s ‘Data Source’.

Prerequisites:

  • SQL Server with a Database and a simple table.

Gateway_13

  • Dynamics 365 subscription. Subscribe to 30 days trail here.

Configure a ‘Gateway’ to on-premise SQL Server:

We need to install ‘On-Premises Data Gateway’ service on the machine with ‘SQL Server’.

  • Connect to PowerApps maker portal using your Dynamics 365 credentials.
  • Go to Data -> Gateways and click on ‘+New gateway’ button.

Gateway_15.PNG

  • You will be redirected to downloads page and click on ‘Download’ under ‘On-Premises Data Gateway’ section.

Gateway_1

  • Download and click on the ‘GatewayInstall’ application.

Gateway_2

  • Provide your Dynamics 365 email (i.e., User ID) and click ‘Sign in’ to connect to Power platform.

Gateway_3

  • Provide your desired gateway name,recovery key and click ‘Configure’

Gateway_4

  • You will end up with below success screen.

Gateway_5

  • We are done with Gateway configuration.
  • If you go to the ‘Services’ on your machine, you should see ‘On-premises data gateway service’ up and running.

Gateway_14

  • Go back to PowerApps portal and refresh the ‘Gateways’ and you should see the configure gateway.

Gateway_6

Create a Canvas App:

As we completed ‘Gateway’ configuration, the next step to create a Canvas app and connect to on-premises SQL server using the ‘Gateway’.

  • Click on ‘+Create’ and choose ‘Canvas app from blank’

Gateway_7

  • Provide the ‘App name’ and click on ‘Create’

Gateway_8

  • Now we need to establish the connectivity between Canvas App and SQL Server.
  • Click on ‘Connect to data’ and select ‘SQL Server’ from the list.

Gateway_9

  • Choose ‘Connect using on-premises data gateway’ option and provide the SQL server, Gateway details and click ‘Create’.

Gateway_10

  • Select the table (i.e.,Contact) and click ‘Connect’ which creates a new ‘Data source’.

Gateway_11

  • Now add a Gallery component and map the ‘Data source’.

Gateway_12

Additional Details:

  • To install the ‘Gateway’, machine should have minimum configuration mentioned here.
  • Gateway installs as ‘On-premises data gateway service’ on the server. Make sure this service is running all the time.
  • Along with service, a desktop application by name ‘On-premises data gateway’ gets installed. You can enable logging and manage settings using this application.

Gateway_16

🙂

PowerApps – Create an ‘Account’ in Dynamics 365 from App using Flow

August 13, 2018 1 comment

If you are new to PowerApps, please go through my previous blog

In this post, lets build an App with an Account Form and create the record in Dynamics 365.

PA_Flow_5

Prerequisite:

  • You must have a PowerApps account. Refer blog for details.
  • Create a Microsoft Flow with logic to create an Account record in Dynamics 365
  • Build an App and trigger Flow

Steps to create Flow:

  • Login to PowerApps Portal
  • Navigate to Business Logic -> Flows -> Create from blank

PA_Flow_1

  • In the new Flow screen, Choose Action, select ‘Dynamics 365’

PA_Flow_7

  • Select ‘Create a new record’ from Actions.
  • Now we need to put place holders in the fields which we pass data from PowerApp.
  • To add a place holder to ‘Account Name’ field, select the field, in ‘Dynamics content’ window, click on ‘Ask in PowerApps‘ button.
    • A new place holder will get added to ‘Account Name’ field.

PA_Flow_2

  • I repeated the above step for ‘Main Phone’ and ‘Description’ fields.

PA_Flow_3

  • Rename the Flow to CreateAccount and Save

Invoke Flow from PowerApp:

  • To know, how to create a new App and add controls to form, refer my earlier blog
  • To trigger the Flow, select the ‘Create’ button, go to ‘Action -> Flows’
  • From the ‘Data’ window, select the flow created in above section (i.e.,CreateAccount)

PA_Flow_4

  • On ‘OnSelect’ event of button, trigger the Flow ‘CreateAccount’ by calling ‘Run’ method and passing the 3 placeholder parameters.
    • CreateAccount.Run(txtName.Text,txtDesc.Text,txtMobile.Text)
  • Thats it, now its time to test the App

Test the App:

  • Press F5
  • Set the values and click ‘Create’

PA_Flow_5

  • Open the D365 App and you should see new ‘Account’ record.

PA_Flow_6

Refer my earlier article to build an App using Excel as Data Source.

🙂

PowerApps – Error while connecting to Excel Data Source

If you are new to PowerApps, please go through my previous blog

In my last Post building, I explained the steps to build an App using Excel file as Data Source.

While I was exploring more with that App, I encountered an error when playing with different excel files.

PA_Excel9

Reason & Fix:

  • If you have formulas defined in the Excel file, PowerApp will throw error as the PowerApps are not supporting Excel containing Formulas at this point.
  • Fix was, I had to delete Formulas and keep only data in the excel file to run the App.

🙂

Categories: PowerApps Tags: , , ,