Adding Editable Grid using the New Power Apps Grid Control in Model-Driven Apps | [Preview]

If you are designing your forms in the Model-Driven Apps designer from the Power Apps Maker i.e. https://make.powerapps.com/, here’s how you can add the New Power Apps Grid (which is in Preview at the time of writing this post)

Scenario

For example, you are in Model Driven Apps designer and you are see the existing Grids, they have only 2 areas in Properties –

  1. Select the Grid and you’ll only see 2 areas –


  2. And if you expand them, you won’t find a way to change the control to, for example, Editable Grid.

  3. That’s where the new Power Apps Grid Control comes hand. This is currently in Preview at the time of writing this post.

New Power Apps Grid Control [Preview]

Now, click on the Components section to reveal all the Components that you could add to the Model-Driven Apps form –

  1. You’ll see the More Components section under which you’ll find the new Power Apps Grid Control.

  2. Now, once you drag is on the form where you want it to be, you’ll be asked to select the records it should hold. It’ll ask you to select the Table which you want to display in the sub-grid.

  3. Once you click on Done, make sure the Show Related Records is selected as well and ensure the Table and View selected is correct.

  4. Now, look for Components section and expand the same. Expanding the Components, you’ll be able to select the Editable Grid.
    Expand the Components section and you’ll find another button to add more components that are made available.

  5. Now, you’ll be able to select the Editable Grid here.

  6. Now that you have added Editable Grid, click Done.

  7. And once you add, you’ll notice that the Mobile, Web etc will be shown under the new grid. Means this is now set as default and not the other 2 views.

  8. Finally, you can save your changes and publish.
    And that’s how you are able to add Editable Grid on the modern Power Apps Model Apps designer using the new Power Apps Grid Component.

  9. And here’s how you’ll be able to add an Editable Grid on the Form using new Power Apps maker.

Here’s the Microsoft Learn link for the same – https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/the-power-apps-grid-control?WT.mc_id=DX-MVP-5003911

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

Advertisement

Logged In User details in a Canvas Power App

You do get some details of the logged in user in a Canvas Power App. Let’s look at what all is available –

undefined

User() Function

User() function provides 3 pieces of information you can retrieve at this point in terms of logged in user.

undefined

Email

Use User().Email to populate a Text field with the Email address of the logged in user.
undefined

Full Name

Use User().FullName to fetch the logged in user’s Full Name and maybe, populate it in a Text/Label field as well
undefined

Image

Use User().Image to be able to populate the Picture control with the logged in User’s Picture. Remember, user needs to add this in their respective Office 365 account in order to appear here
undefined
undefined

User Details

Now, whenever a logged in user comes across these controls which we set above, the User details will vary for each user respectively. Below is how it looks for me.

undefined

You can obviously use it as and where it suits you.

Here are some more Canvas Power Apps posts you might want to look at –

  1. Variables in Canvas Power Apps | Global and Context
  2. Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App
  3. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  4. Adding a Canvas PowerApp to Teams
  5. Sending Image from Canvas PowerApps to SharePoint Document Library using Flows

Hope this was easy and helpful!

Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App

Most common scenarios are where you need users to be able to Exit the Canvas Power Apps in the below ways –
Scenario – Let’s say you put a close button somewhere in your App.
undefined

  1. Exit the current App but stay logged-in to Power Apps.
  2. Exist and Logout Power Apps entirely.
  3. In both above cases, ask user for confirmation before exiting.

So let’ look at these scenarios one by one –

Exit from current App

  1. Now, let’s say you’ve put a Close button on your App like this. And when you click it –
    undefined
  2. It takes you to the App selection screen in your Power Apps
    undefined
  3. You can implement this using Exit() method on OnSelect property of the Close button as shown below
    undefined

    And that’s it.


Exit and Logout of Power Apps

  1. Another variation to the same feature would be to Exit the App as well as Logging out completely. Now, I’ve put a Lock button here to represent Logout.
    undefined

  2. You can implement this by using Exit(true) method as shown below
    undefined
  3. And, it will logout the PowerApps Application itself.
    undefined
    And you’ll need to log in all over again.

Confirm before Exit

This is a feature that will work with both, Exit() and Exit(true). It will ask you for a confirmation on whether if you really like to close/logout the app?

  1. Select App in the left-hand Tree view, select App
    undefined
  2. And look at the right hand Properties menu – The Confirm exit and Confirm exit message will let you enable this feature with the message you want to display –
    undefined

    And you can set your message
    undefined
  3. And then, when you either Logout or try to Close the App, you’ll be prompted with this message
    undefined


    Note: For all the changes to take place in Canvas Power App, make sure all changes are Published and you force close and re-open the Power App (if using on a mobile device / Tablet). Wait for a few seconds to get notified about the latest version being available.

And it’s all that simple! In case you are looking for more articles on Canvas Power Apps, you might want to check these below –

  1. Variables in Canvas Power Apps | Global and Context
  2. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  3. Adding a Canvas PowerApp to Teams
  4. Correctly connect to an Excel file in a Canvas PowerApp
  5. Sending Image from Canvas PowerApps to SharePoint Document Library using Flows

Hope this helps!

AutoNumber field in CDS | PowerApps

The most desired feature is ability to create/customize your own auto-number field. ANd CDS let’s your do just that!

I remember the good old days when I had to write a plugin to function for AutoNumber which used to configuration from a supposedly separate Configuration entity and it scary to maintain the code and entity. But this solves all that with so much ease!
allRecords

Create an AutoNumber field in CDS

  1. Now, you can start by creating a field in CDS’ Solutions > [YourSolution]> [YourEntity]
    createNew
  2. Then, under Accounts, you can see that you can actually create an Autonumber. This is not available in Classic UI.
    Also, please note that you’ll need to keep this field Not Required and Locked (on the form) in order to function.
    underTextGroup
  3. Give it  a suitable name and then you have 3 options to format your auto-number field.
    2TypesOfAutonumber

    String Prefixed number

    You’ll need to define the Prefix, Min Digits, Seed value
    preview

    Date prefixed number

    With Date prefixed, you’ll need to define Date Format, Min Digits of Seed Value
    dateFieldPreview

    Custom

    With custom, you can define the Format. Refer Microsoft’s Documentation for the same – AutoNumberFormat options
    customPreview

Save and Publish as you usually would and place your field on the form you want.

Working

I used String method to design my AutoNumber field. Let’s see how it looks –
Once I save the record, the Auto-number will be filled in.
fieldWorking

If you happen to delete any records already created in the sequence, the auto-number functionality will continue counting upward and not fill out previous backlogs/last deleted auto-number records.

Hope this helps!

Button Flow in Power Automate to replicate a Quick Create Form in D365 CE

I wanted to try a quick example of a Flow Button. I thought, why not make a simple Quick Create like form to enter data in Dynamics from Flow itself? So here’s a little form I did –

Create Button Flow in Power Automate

Now, let’s start of by creating a Flow button itself.

  1. Choose the template to create a Flow button.
    createFlowButton
  2. And give a suitable name and select the Flow trigger which is a button
    createAccountNew
  3. Now, select what input controls you want to add to the Flow Button. Click on Add Input and then select the Input you want to start off with
    addInput
    chooseControl
  4. Now, since in this example, I’m trying to create a simple Quick Create like form for D365, I’ll choose the most obvious fields I want and create the inputs as below
    buttonLayout
  5. Further, I’ll connect the same to CDS and Create a record in Dynamics using the input I receive from the Flow button, so – my CDS mapping in the Flow below looks like this –
    upperFlowBody
    I’ve mapped the Company Name and Annual Revenue fields.

    And now, I map the remaining Email address field to create my record.
    lowerFlowBody

    My Flow is now ready and after testing it, I’m ready to use it on my phone.

Run the Button Flow on Phone

On the phone app, make sure you have access to the Flow and navigate to Buttons on the screen-

  1. In Power Automate app, open the Buttons section and check for the Flow Button you created – Create Account in this case –
    buttonView
  2. Once you push the button, you’ll see the form you created with the input fields
    blankForm
  3. Finally, when you fill out the form, you’ll simply need to hit Done and that should be it.
    readyToSubmit

 

Check the Record in D365

Now, if you check in Dynamics, the record must’ve been created already!
record

 

Hope this quick tutorial helps!!

Adding a Canvas PowerApp to Teams

Let’s take a look at how you can simply export the Canvas App from your Organization and import it to Teams. And you should be good to go!

Exporting Canvas App

  1. Assuming you are an Admin and you have Owner/Co-Owner rights to the App, you can click the ellipses part on the App and look for Add to Teams option.
    addToTeams
  2. Once done, you can check on the right hand-side to see some details and Download the zip file of the Canvas App when ready
    downloadApp
  3. And that’s it, it gets downloaded like any other Model Driven/Canvas App solution file.
    downloaded

 

Importing App to Teams

  1. Now, you can import the same as a custom App in Teams. Navigate to the Apps section and look for Upload a custom app in menu as shown below.
    uploadACustomApp
  2. Now, chose the Org you want to import the solution file to. In my case, it’s just one organization, you may have multiple.
    selectOrg
  3. A dialog box will pop up to ask you to select the solution file, navigate to the saved location and pick the file.
    selectSolution
  4. And you’re ready. The App has been imported. You can see it in the Apps section under Built for CFT 146.
    findAppOnTeams

 

Adding App Per User

Each user needs to add the App themselves in order to be able to access it.

Also, remember that the user who is adding the App should have rights to access the App itself i.e. the App should be shared with those users.

Let’s say Kuldeep is another user in the CFT 146 Organization. He can explicitly search for the App and add it as below –

  1. Go to Apps, then look for the area, Build For <Org Name> and then look for the App that was imported.
    Attendees AppfindAppOnTeams
  2. Click on the App, and the dialog box will provide with a button to Add to Teams, along with other details mentioned alongside.
    clickAdd
  3. Once added, it will appear next in the left navigation menu and you can simply run it by clicking on it.
    appRunning
  4. In case the user doesn’t have appropriate rights on the App, they will see this message when trying to open the App in Teams.
    errorInAccessing

Hope this helps!! Happy 365ing!

Correctly connect to an Excel file in a Canvas PowerApp

Now, just putting an Excel with some crude data in it won’t really be identified in the Canvas App you are making. Perhaps you’re missing something.

Let’s say, I want to read an Excel file from OneDrive For Business into my Canvas App, I select the Excel file from the OneDrive for Business connection like below –

excelToConnect

But, I’m treated with the below error while making a connection – CanvasAppExcel

 

Correcting your Excel

Well, if your Excel looks like this –

crudeExcel

Then, that’s the reason Canvas App is not able to connect to the data in the Excel. Here’s what you need to do – click on the top left corner of where your Table should start from and then click on Table from the Insert tab as shown below
convertToTable

Confirm that diagonal end of the Table you want to consider and click OK once confirmed
confirmSelection

Once you confirm, you’re Excel data will look like this which is correctly formatted into a Table –
formattedTable

 

Reading the Table

Now that you’re set, you should be able to read the Excel file’s Table which you can connect to.
tableAppeared

Hope this quick tip helps!!

 

Create new CDS Environment and Database quickly from PowerApps Admin Center

With the April 2019 Updates, you can straight way create new D365 instances right from the PowerPlatform Admin Center.

Create New Environment

Follow these steps to create your environment from PowerPlatform Admin Center

  1. Go to https://admin.powerapps.com/environments and you’ll see an option to create New Environment.
    createNew
  2. Fill suitable details and proceed. Also, check the last section in this blog to see the difference since I chose another region than my source/original tenant when I created the D365 Trial instance (It was North America).
    specs.png
  3. You’ll see the message once this is being created.
    creating
  4. Finally, once completed, you’ll see this message where you’ll be asked if you want to proceed to creating the database as well. I recommend to create the Database as well, this will save time.
    asksToCreateDatabase

Creating Database

Considering you came here from creating the environment itself rather than choosing to create a Database to an existing environment, we’ll see how we proceed from the last Create database section.

Once you select the Create database from point #4 in the above section, you’ll see be asked to select the preferences of the database.
selectCurrency

Once you select the Currency and Language, the creation of the database will take place
creatingCDSDatabase

Once done, you’ll see that the environment and database will appear in your list.
createdENV

When you open the environment, you’ll see that for a few moments, this is being provisioned.
provisioning
Once the message goes away, you’re all set!

Instance Region

Now, note that my CDS Environment is created in the Asia Pacific (APAC) Region.
asiaRegion
And I don’t see my other regions here because the URL I’m on is port.crm5.dynamics.com

crm5URL

Whereas my original D365 Instance that got created with this trial exists on the port.crm.dynamics.com Admin Center
crmURL

 

Hope this quick post helps! 🙂

Sending Image from Canvas PowerApps to SharePoint Document Library using Flows

One of the most common requirements is to upload images to SharePoint using PowerApps. From my learning from various sources, I’ll try to “demystify” my explanation to send/upload an image to SharePoint Document Library using Flows on my Canvas PowerApp.

Ingredients

Assuming you have the following things already  in place in PowerApps as well as in SharePoint

  1. PowerApps’ Camera/Image control and a Submit button. In my case, the image above is a camera so that I capture the image I want and the image below is the Image control to show me what I clicked.
    powerApp
  2. A SharePoint Document Library to record, say, Incidents.
    spDocLibrary
  3. We will get to the Submit button on the PowerApp once we create our Flow.

Flow

Let’s create a Flow to pick the Image from your PowerApp, convert it to binary and send it to the SharePoint Document Folder location called Incidents.

  1. Since we want to trigger the Flow from the PowerApps itself, we will select the trigger of the Flow as ‘From PowerApps’ and hit Create
    createFlow
  2. Once your Flow is ready, leave the first step of PowerApps because that’s the trigger. Add Step to create a SharePoint file and fill in the details of the Document Library you have created.
    createSPFile
  3. Fill in the FileContent as above. You’ll need this to be converted in the intermediate step after this.
  4. Now, you’ll need to add an additional step in between PowerApps and the Create SP File step as below. It will be a Compose action.
    addAction
  5. In Compose action, under Expression, select dataUriToBinary expression and make sure you open the bracket as well.
    dataUriToBinary
    toolTipHidden
  6. Now, go back to the Dynamic Content section and select the CreateFile_FileContent to complete the formula.
    fileContentAvailable
    completedFormula
  7. Click OK on the screenshot above and the formula should be set.
  8. Now, replace the File Content section to take in the Output of the Compose step.
    outputRecorded
  9. Save your Flow and your complete Flow should look like this.
    CompleteFlow
  10. I’m naming my Flow as ‘IncidentFlow’ so that I can identify it.
    incidentFlow

Adding the Flow to Submit button

Going back to the PowerApp, let’s Run this Flow on the selection of the Submit button and pass the image.

  1. Now, select the Submit button, and on the Formula bar, add the Flow you created, I named it IncidentRun. Select the same so that the Formula comes as IncidentRun.Run( for you to pass on the image.
    Now, pass the latest image on the collection i.e. the same image which is being displayed in the image control below.

    runFlowFormula

 

Running the App

I just ran the app on the desktop itself, you could do it from your phone too!
So I clicked on the Camera when I was ready, the image appeared in the image control and I that was what I wanted to upload. So I clicked on Submit button.
hittingSubmit

The flow was successful
FlowSuccessful

And my image was in SharePoint too!
imageUploaded

I know it is a lengthy post but I tried to summarize as much as possible. Make sure you have a way to uniquely name each file or else, the same file will be overridden.

Thank you!

 

Create your first PowerApp! Connect to SharePoint Online List

PowerPlatform is the next big thing in

PowerApps comes with several Dynamics 365 licenses and make sure you have been assigned one as well as below –
license

Navigate to https://web.powerapps.com/ to go to the Admin Center and here you can simply start working on your first app.

In this scenario, I want to be able to read from my SharePoint Online list and make decisions based on what data is in the List
spList

Build your PowerApp from data

  1. Among the options to create your app from either Canvas or Model-driven, I’ll chose to build one based on data which is a Canvas type of application.
    startFromData
  2. Now, I’ll chose SharePoint’s Phone layout since I want to connect to my SharePoint Online site to be able to read from my lists
    selectSPApp
  3. Now, since I already have selected SharePoint connector, I’ll be creating a new connection on the next page.
    createSPConnection
    Since this example is for SharePoint Online, I’ll select Connect directly (cloud services).
  4. Now, since I already had accessed the SharePoint Site, it appears in my list. You can either connect to a new Site from + New Connection button on the left-hand side or enter a new SharePoint Site in the URL and click GO. Or even select a recently visited one like I did –
    selectSPSiteFromRecent
  5. Then, choose your list
    chooseList
  6. And it takes a few moments to build out your App. And when it’s ready to be worked on, here’s what you get.
    appIsReady

Understanding your App Designer space

Won’t be covering much details on what each tool does, but wanted to share how things are placed –

  1. On the left-hand side, the App pages/components are divided into three main sections. (Obviously, you are free to add and modify more screens as needed)
    defaultTreeView
  2. You can add several controls on these screens
    insertTab
  3. And these controls/components can be adjusted from the right-hand side pane as below
    customizeProperties
  4. That’s basically the most of the App basics you need to know at this point. I’ll post more posts on that later. 🙂

Publishing Your App & Share

Presuming that your app is now ready to go, her’s what you can do in order to publish

  1. Navigate to File, give a suitable Name to your App.
    appName
  2. Move over to Save and Save your App.
    saveApp
  3. Once Saved, Share the App.
    shareThisApp
  4. Once you click on Share, you can get to Add users who will have access to this App and you can chose their permission level.
    shareWithUser
    permissionSelection

Running your first PowerApp

Assuming you have installed PowerApps on your device and logged in with your credentials, you’ll see the App as below

And you can start working on your App already

Hope this was quick. And then there’s a tremendous lot to be done with PowerApps and leveraging the PowerPlatform!