Introduction

Some days ago on posted just a screenshot on LinkedIn showing a flow that would share D365 Finance and Operations (Finance and Supply Chain Management) embedded Power Apps with all users that are working with D365 FinOps.

As many PMed me to know how I did this, I decided to create this little post – so let’s get started.

Let’s imagine we are a company that is totally fine with what D365 Finance and Operations does in standard and we added some required extra functionality using Microsoft Power Platform – here especially Power Apps. We all know it can be a pain to share all necessary apps with all users, each time we want to deploy a Power App.

Where do we start?

There are many points to start. 1. When a new User is added to D365
2. When a new App is created
3. on demand ….

For this time I’ll go with the on demand version. You could to it based on Users in D365 if you’d just place an alert on the users table in D365 and fire the flow from there. It’s up to you 🙂

Firing Microsoft Power Automate (aka MS Flow) by demand to share all Power Apps.

I don’t need to tell you how to add the “Button” trigger to Power Automate Flows – let’s go ahead with step no. 2

Get System Users from D365 FinOps Create a new step in your flow and list your System users.
Required Entity: SystemUsers

As we are setting app user rights later I just excluded myself from the list to avoid getting read rights on my apps instead of admin rights 🙂

I added Alias ne 'MYMAILADDRESS' as the filter query. Please extend or replace as per your requirement.

Get System Users from D365 FinOps

Get your shareable Apps

now it’s about to get the list of all apps to be shared. As in PreSales we have a lot of cases and lots of Apps I prefere to manage which apps to share.
Therefore I built an entity just holding the Apps per Case so two rows are required 1. Just a Name for the App
2. Link to the App (from Entity ‘Apps’)

You might of course just extend you ‘Apps’ Entity by fields like ‘user role’ or ‘share with D365?’ – you know what I mean.

See here the flow step to get the list of Apps

Get List of shareable apps
Get List of shareable apps

and here just a 2 column entity

Entity to Manage Shareable Apps
Entity to Manage Shareable Apps

Process Users

Now lets process all users. For that I just added a ‘For Each’ loop. Input should be the value property of your “get system users” action. Now we have to get some information from the ‘office users’ connector. So add it to the flow and set the search term to the ‘Email’ or ‘Alias’ field of the ‘get system users’ action.
(Alias is more often filled with information than email, maybe you would prefere the ‘Alias” field.)

Process all users
Process all users

Inside the Users loop we now add another loop to process the office information. Indeed we are only fetching one data set from the office connector and we could do this step more sexy by just using the first value of the dataset, but for effeciency I decided to go for this loop.

Process Office 365 Information
Process Office 365 Information

Share All Apps

Inside this loop we add another loop to process every single app. The connector used at this point is the ‘Power Apps for App Makers’ Connector.

See documentation here: LINK

I set the values as followsAPI Version = 2016-11-01
Filter Query = environment eq ''
Content Type = application/json
Put Email = Email field coming from office 365 connector for this item
Put Id = User ID field coming from office 365 connector for this item
Put Type = User (which makes the new user a normal user)
put roleName = CanView (which is good to avoid people from editing your apps)

Process all Apps
Process all Apps

Le Fin

So – that’s all for now. Hope you can do something with it. Sure there is much open space for productive usage or advanced administration purposes 🙂 let me know when you make a proper version off it.

Just for your overview… all loops in loops 🙂

Loops in loops
Loops in loops

Cheers!