Wednesday, October 11, 2017

CRM and PowerApps revisited

Last year in June, I had written a blog about PowerApps. I created a simple app that could update a few fields and the entity image of Contact records, but there were a few problems with the functionality. Microsoft Flow, CDS and PowerApps are getting a lot of attention these days, so I decided to revisit my original blog and create the same app with latest PowerApps functionality. Since the PowerApps studio has changed from the original version, I have a made a few changes to the app as well. I am using PowerApps app installed on my Windows 10 machine.

Here are the steps:

Creating an app using Dynamics 365 as data source


Create connection and generate a default app

  1. In PowerApps, Select New  >> Start with your data” >> Dynamics 365 , as shown in the screenshot below.

    2017-10-08_21-42-12
  2. Create a new connection to your CRM Online organisation. In my case, I already have connections, as shown in the screenshot. Click on the dataset for your organisation (in my case it is HPE).

    2017-10-08_21-44-03
  3. Select Contacts from the dropdown and click Connect, as shown in the screenshot.

    2017-10-08_21-44-44
  4. PowerApps will create an app. The app will have 3 Screens:
    • BrowseScreen1 (Home Page with a list of the contacts and a search box)
    • DetailScreen1 (Displays the details of the selected item on BrowseScreen1)
    • EditScreen1 (Opens the selected record/new record in edit mode)

Update search and sort conditions on the browse screen

  1. On BrowseScreen1, select the browse gallery. the editor will display the Items properties.

    2017-10-10_23-20-45
  2. Change the value of the “Items” property to SortByColumns(Search(Contacts, TextSearchBox1.Text, "fullname"), "lastname", If(SortDescending1, Descending, Ascending)). It will change the search criteria to “fullname” and sort the records by “lastname”.

Select fields to display in the gallery

  1. Select the fields in the first item of the gallery and choose the CRM field you would like to display in that control, as shown in the screenshot below.

    2017-10-10_23-35-12
  2. Choose the other fields to display in the gallery. The image control on the gallery is already set to display the entityimage of the contact.

    2017-10-10_23-43-13

Select the fields on Detail and Edit screen

  1. Select DetailScreen1 and then select Data sources from the View Menu. It will display the Data window as shown in the screenshot below.

    2017-10-11_00-00-48
  2. Select DetailForm1. It will display all the available fields in the Data pane as shown in the screenshot. Click on the purple eye in the options pane to add or remove the fields on the form.

    2017-10-11_00-06-16

Change the theme of the app

  1. You can change the color schema for the app by selecting predefined themes under Home>>Themes.

    2017-10-11_10-17-21

Save and Share the app

  1. Save the app by providing the name of the app. You have an option to save the app on the cloud or on the local machine.

    2017-10-11_00-17-27
  2. Share your app with your colleagues by selecting Share this app.

    2017-10-11_10-22-40

Testing the App

I am testing this app on iPhone 7S. To run PowerApps on your mobile device, install PowerApps from the app store.
  1. Logon to the PowerApps and choose your app.

    2017-10-11_11-27-56
  2. The app will display the browse screen.

    2017-10-11_11-30-11
  3. Select the record to view the detail screen. All the fields are disabled on this screen.

    2017-10-11_11-32-33
  4. Click on the edit icon to edit the record.

    2017-10-11_11-33-11
  5. Click on Change Picture to upload a picture. On iPhone, you will get the following options.

    2017-10-11_11-34-15
  6. Take a new picture/select an existing picture and press save.

    2017-10-11_11-35-30
  7. Have a look at the browse screen. It should display a picture on the edited record.

    2017-10-11_11-36-38

Conclusion

In general, I think PowerApps is great to build something quick instead of spending months to go live, but performance must be improved to make it usable in the real world.

Improvements

There are a few improvements in the latest version of PowerApps.
  1. Image control can display CRM entity images. This was not working a year ago.
  2. Image control can access iPhone camera. In my last attempt, I had to add the camera control to take the picture.
  3. The performance is better than a year ago.

Issues

  1. Photos take a long time to load. On the browser screen, the data fields load very quickly but photos appear after a few minutes.

  2. Users can’t control the orientation of the photos selected in the image control. Some photos get loaded with the wrong orientation. I have read on the PowerApps community forum that the PowerApps team is working on it.

  3. CRM connector does not have an option to retrieve specific columns instead of all the columns.

1 comment: