Model Driven App Advanced Settings – New look

We all knew it was a matter of time before the old UI would be replaced, and soon we are one major step closer to being rid of everything old UI.👏🏼👍🏼

The old Advanced Settings that so many people are used to navigating is about to get a new look, and this time as a separate APP. APP you say… Well, yes.. Just like the Sales HUB configuration, lots of parameters are not typical records in a table, and therefore it needs to represent configuration parameters in a different visual experience.

This is obviously still in preview and only available via the USA preview environment, but it should be arriving soon. Of course, there will be lots of initial bugs with this, but give it some time before it hits GA. Be constructive in the criticism and you might actually see the changes implemented 💡👍🏼

Why are some skeptical to the change?

There are 2 obvious reasons why some are still skeptical about the loss of classical UI.

  1. Advanced Find is soon GONE.
  2. Classical Solution config will also be GONE

Advanced Find has been given a new UI through the global search feature, BUT this search doesn’t include all tables. Only includes the tables that have been included in the application. This is a huge limitation for those who actively use Advanced Find a lot to really understand the underlying data.

Classic Solution Configuration is still the preferred way to navigate within a solution for many. Mostly because the navigation itself is a lot faster between entities (once loaded), and because it’s really well known for most OG’s 😉. Another point to be made is that not all configurations are possible YET in the MAKE portal (some components), but I am sure they will be rushed along once we finally land on 1 common config platform for all consultants.

Thank you to https://www.linkedin.com/in/allandecastro/ for notifying me about this preview feature.

ACDC 2024 – Why this is the ultimate hackathon

It’s almost been 3 weeks since the hackathon and I am a bit late on my summary of experiences. February has been hectic, but better late than never 🙂

I have written about ACDC earlier and they all have a bit of a different perspective each time that I participate:
ACDC 2021 – Summary
ACDC 2022 – Summary
ACDC 2023 – Summary

This hackathon provides the most unique learning experience for Microsoft techies in every single way. 13 teams locked into a giant auditorium for 3 days having a blast learning things they didn’t know before! Sure there are other hackathons with many teams, but they are not forced to eat, sleep, breathe together for 3 days straight 😂

Being humbled is a valuable learning experience

I have about 16 years of experience in this world of Dynamics / Power Apps, and have to admit that I am extremely comfortable in the space of Dynamics 365. Like many other people in my situation, it’s easy to stay inside my safe area, and let others handle technology that is not so well known. This also defeats the purpose of the hackathon.

Long story short, Nick Doelman contacted me this year asking if he could be a part of Point Taken’s team, and I was instantly intrigued about it. I know him as an MVP, but we haven’t hung out a lot before. Nick is one of the best you can get on Power Pages, and is generally a very high end consultant within Dynamics / Power Platform. It was given that he would provide the team with a lot of important knowledge, so we agreed to give it a go. Ohhhh what a joyful experience it was! 🥰

Nick’s first demand was:

No one is going to do what they normally do in their everyday work!

Nick Doelman

Probably a bit dramatic quoting him like that, but what’s not to love with a little theatrics😂 The main reason for him to say this was because we are here to learn. If we end up solving Business issues like we do every single day, we could just as well stay at our customers and billed hours. He literally pushed us out of our comfort zone even before we had started. We all agreed that it would be fun, but none of us at this point were sure what to expect.

Nick took the lead on the app that would be the main point of our delivery. In short, it was a Canvas app (😂”low code”😂 ) that would use OpenAI to randomly generate maps for a game. Not only was the game randomized, but the themes would also be random based on keywords entered at the beginning of the setup. Read more about our app below⬇️

What impressed me the most was seeing how Nick embraced the new technology that he hadn’t worked a lot with yet, while mastering highly advanced elements in such a short time. I do often mention the quote of the “Old dog new tricks”, but it’s a real feeling. Having the energy to constantly learn new technology is not easy.

While sharing his knowledge with the team, he also showed us some really important skills as a consultant. His logical approach to solve a problem, and his ability to talk about what was going to be solved. A good sales pitch itself can land large scale projects even before the customer has seen any evidence that it works. This could also have been on of our problems as a team, because the first day pitch was so amazing that we almost couldn’t deliver on our promise in the end😂

I consider myself a quick-thinking consultant with a charm that usually helps me win projects. However, Nick’s many years of experience not only nailed the pitch but also showcased how to be a top-notch consultant in all aspects during a challenging 3-day hackathon. I’m not trying to be Nick – I’m Thomas. I can take his wisdom and make it work with my own style, learning and growing in the process.

That is the core value of ACDC https://arcticclouddeveloperchallenge.net

Final Delivery

Interested in seeing what we did, have a look at our blog post

Security Roles – The 3 Phases

Security Roles the least fun part about Power Platform – Dataverse / Dynamics 365. I would rather use hours finding the right ICON for every single custom entity😂. Yet security roles happen to be the pilar of why our platform is so much more powerful than other technical platforms.

I find that my approach to security roles almost always ends up the same way when I deliver new solutions. Therefore I thought I would share a bit of what goes through my mind in the different stages:)

1. Creating the role

There are many blogs about creating roles, and recently we even received a new modern way of modifying security roles. I’m not going to cover the hows, but you can pick up a few tips from the following blogs:

Blogs about the new ways of creating roles:
https://learn.microsoft.com/en-us/power-platform/admin/security-roles-privileges
https://malindonosomartnes.com/2023/06/29/new-security-roles-admin/
https://nishantrana.me/2023/05/01/manage-security-roles-using-the-new-modern-ui-preview-power-platform-admin-center/

What I do want to share is my personal opinion on where to start. As you know I mostly work with Dynamics 365 and not pure Power Platform environments. If I am delivering a Sales solution I almost always start off by copying the Salesperson’s security role.

Don’t ever start a security role from scratch. It’s simply not worth the time.

So for Dynamics sales I would typically just copy the Salesperson as a start

And for Power Platform I might start with Basic User as a start.

A typical error I do is hoping that I can end up with a single security role to make things simple. Pushing all users into the same role because why not. I am one for more access to users, and depend on teaching people to handle data with respect. Within the first few weeks, you soon realize that you probably need an admin role for administrative tasks.

PS: One thing I always do is of course to limit any delete actions for ALL users the first few weeks so that they don’t blame the system for GHOST deleting items. Yes, that has happened! 🤷‍♂️

2. Assigning the role

After hours of banging your head on the wall, trying to figure out what security privileges you are missing for the application to work as expected, you arrive at the next task of assigning the security roles to the users.

The next error that I have done more than once is thinking that we can manage the security roles directly on the user. To begin with I use a tool like XrmToolBox to deploy roles to multiple users at the same time, but a few weeks/months down the line people hired/fired/re-org having to make these changes often is going to take way too much time. Having to bill for these changes is also going to be frowned upon because it’s “just a simple task”.

Traditionally this has been very straightforward for the sales and customer service users, but lately, this is becoming more and more of a challenge. With the release of new functions, you will soon understand that keeping up with security roles is almost impossible. With new solutions from Microsoft being installed automatically, you might also see a few security roles to follow along. Examples of this would be the Forecasting functionality to sales.

Normally one would think “Let’s just add these to the main security role for all users” BUT there are times when the actual security role ID/Name is the one opening up the functionality.

The Dynamics 365 app for Outlook User is one of these apps I believe. In order to actually qualify for the app deployment, you need this security role.

So my first initial thought that one user could have “Salesperson” as a single role with all of the functionality is now turning into a nightmare handling pr user. I now have to manage lots and lots of users/changes etc while trying to maintain the correct roles given.
The image below is just an example

3. Structuring the security roles with teams

This leads us to the final phase of security roles for me, where I realize that I should have done things right from the beginning. Using the extra time early on so that I save time when the project is live😤

Just like marketing people are oddly obsessed with personas, we have to think about what types of users do we expect to see in Dynamics / Power Platform. In a simple solution, you could easily have the following personas.

  1. Sales User
  2. Sales Admin
  3. Marketing user

Dynamics users are well aware of teams being able to connect security roles, but Power Platform users are not always aware of this.

Create a team, add users, and then add the security roles. This is a much simpler way of managing changes in security roles because changes only need to happen in 1 place.

Hold up

The problem with this solution is that Dynamics / Power Platform consultant or someone familiar with Dynamics / Power Platform needs to make these changes. In a worst-case scenario, a company would have IT create a user and assign a license. THEN they would have to contact other consultants to add security roles or add someone to the team for correct access. This method is flawed and will at some time become a problem. Microsoft has fortunately given us a great solution for this.

Solution✅ – AAD Security Groups / Entra Identity Security Group

I am not going to cover how to create a security group in AD and later on, add it to Dynamics / Dataverse. Have a look at the following posts for these tasks:

https://learn.microsoft.com/en-us/power-platform/admin/manage-group-teams#create-a-group-team
https://forwardforever.com/how-groups-teams-work-in-power-apps-dataverse/

What I think is so important about the Security Group is that it removes the burden of access from the Dynamics / Power Platform consultant, and puts it in the hands of IT managing general access to all systems in AD. This just makes so much more sense, because these people normally do the on/off-boarding for all technical aspects. All you have to worry about is that security roles are given to the correct team.

Within Dynamics / Dataverse there is no difference in how to assign security roles BUT there is a major difference in having the members auto-populated based on AD security groups.

Moral of the story

Use Security Groups unless you have a very good reason not to 😘

Code is code – You are a developer! 💯

For those of you that follow me on twitter and other media, I recently posted out a few questions to trigger some conversation about code. Specifically it was JavaScript code for a functional consultant. The feedback was extremely varied, and that was my hope. I of course have an opinion on the matter, but didn’t want to voice it before I heard what people in general feel about the subject.

This is only from my twitter, but had a similar thing on the Dynamics group of Facebook. There are not a lot of votes here, but in general it’s fair to conclude that most don’t agree with me in regards to Dynamics 365 JavaScript.

I personally think that functional consultants need to know BASIC JavasScript for Model Driven Apps. Examples of basic to me is the Hide/Show with potentially a few calculations. The obvious reason for this is the user expecting to se changes in the app visually while they are entering data. Having things calculated asynchronous is just not good enough when working in a Model Driven App.

But JavaScript doesn’t run server side. You cant use that!

Someone

True, but sometimes the code doesn’t need to be server side, because we can guarantee that the usage is being done within the app. Other times integrations might directly update data and the scenario might be different. The point I am trying to make, is that you should be able to choose the technology because you know how to do it. Not choose the tech based on what your limitations are. There are way to many implementations that are absolutely chaos taking over because of Business Rules, Calculated Fields or Formula Column bombardment.

But I’m not a developer??!?🤷‍♀️

Well.. Is that really true? I hope you don’t mind me quoting you Steve, but I 100% agree with you on Code is Code. I know you are referring to the idea that this should be done by dev’s, but what would life be if we all agreed on everything? hehe.

I see tons of functional consultants accepting that PowerFX in Canvas Apps is just “Excel formula”. Looking at the example below of an update statement….. How is this not ProCode?

How is this any easier than JavaScript if you just look at syntax for a hide/show?

I understand that these are to absolutely different functions, but the whole idea of accepting PowerFX as a Low-Code language should mean that you also accept JavaScript to be a Low-Code language.

These to languages are so extremely different in logic. My mind is made up of sequences of actions, and that’s why JavaScript makes sense, while PowerFX in Canvas is the result of whatever happened in a prior action(and that fries my brain sometimes).

But JavaScript it’s to hard to learn!

Nothing is harder than learn to do Canvas Apps correctly. I have been doing it on and off for years already, and I still feel like I am a terrible app developer in Canvas. You all know I am from the Dynamics background and wish most things would be in the context of a Model Driven App. I accept that I am not a creative person, and that a button is a good button as long as it works (not because of rounded corners😂).

JavaScript is just something that you have to do a few times in a test environment and you will quickly see that it’s a lot simpler than you actually thought. Most of the stuff being done in JavaScript these days is hide/show’s and simple calculations. The heavy JavaScript’s that we used to see have in many cases been replaced with other tech (Custom Pages, PCF Components etc).

Later this year I will try to release a YouTube course “JavaScript 4 Dummies, by a Dummie”. It will be my take on simple JavaScript, and I will make sure that everyone will understand the basic principles of HowTo JavaScript.

🙃BUT UNTILL THEN🙃
I am actually going to record a series on “Plugin’s for Dummies, by a Dummie”. Wonder if people will accept a Plugin as Low-Code?!???! haha.. Don’t worry.. It’s Pro-Code, but it’s not impossible now that we have GPT to help us out with syntax! More info to come👏❤

Dev Environments Dataverse

Did you recently see the update from Power CAT announcing the 3 dev environments pr user?!?! The topic of more than one dev environment has been discussed in several forums over the last years, but finally, it is here. Go check out the video on YouTube about the details:

In short a few key takeaways:

  1. 3 Dev environments PR user
  2. 2 GB of data pr environment (does not count against storage)
  3. Premium Connectors included for testing
  4. ALM setup for getting to know solution management better
  5. Automatic cleanup of environments over time (if inactive).
  6. Ability to create dev environments from https://make.powerapps.com

make.powerapps.com

Or should I say https://make.preview.powerapps.com <- for now:) Depending on when it will be released to everyone, the ability to add environments from make.powerapps portal is not yet rolled out. Go to the PREVIEW make, and you should be able to see it there. This is important for users without access to the admin.powerplatform.com.

Go ahead and try it out and see where the limitations are. The important part here is to learn new things by trying them out. Enjoy!

Custom Page – Opportunity Close Solution Download

Initially, I was just going to explore some possibilities with Custom Pages, but decided to make a solution out of it instead. This way you can just download the solution and do the required modifications for your project (GIPHY API key), and you are good to go😁

I am really excited to hear your feedback after seeing/trying this out, and hopefully, I will be able to make it a lot better in next revisions of the Custom Page!

Go to my GitHub to get a hold of the solution. It’s a pretty “thin” solution that should be easy to configure and easy to delete if you no longer need it.

💾 DOWNLOAD 💾

I have also included a video displaying how you install and use the solution

Installation and setup

Because of ribbon changes, I was forced to create a managed solution for this. The only way it wouldn’t overwrite the current opportunity ribbon.

If you want to play around with the solution, download the unmanaged. Just make sure you don’t have any other ribbon customizations on Opportunity. If you do back it up first!!

For everyone else, you have to download the managed solution to be on the safe side.

On my Gihub page I have written what components get installed, so you can easily remove it all at a later point in time.

Custom Page – Teams Integration

Did you think my last post was the final stage of the “Custom Page – Win Notification“? Of course not!! We have one more important step to complete the whole solution.

I am all about salespeople being able to boast about their sales. If you meet a salesperson who doesn’t love to brag about closing, are they even in sales? 😉

Communication is key when you work in organizations of any size and location Onprem/Online/Hybrid. Doesn’t matter where you work, we can all agree that spreading the word around, and making sure everyone gets the latest news is hard. Microsoft is making it pretty obvious that Teams is a preferred channel, so that’s where I also wanted to focus my energy.

Notify the team

I decided to extend the solution a bit to reuse the GIF that we got from the last closing screen, and include it in the Teams integration that I wrote about earlier in the Adaptive Cards.

The first thing I did was to add a new group of fields for the Teams notification. I wanted to let the user choose if they wanted to post the sales to Teams or not. The obvious reason is that some opportunities might have to be reopened, and you don’t want the credit 2 times etc. It’s just a simple logo, text and boolean field.

The next step is adding the variable BoolPostTeams to the run statement of the Power Automate when I click “Confirm Win”.

On the Flow side of things, I will now receive 1 more variable that I can handle. Because I wanted to use the bool type, I have to convert the string “true/false” to a boolean

bool(triggerBody()['Initializevariable2_Value']) 

What team are we updating?

Glad you asked 😉 A part of the solution is to include a Team ID and Channel ID. I added these fields to the Business Unit Table. When we store the Teams/Channel ID’s at this level, we can reuse the same solution for several teams in an organization without having to hard code anything.

These are simple text fields that will hold the unique values to the Team and the Channel you want to notify.

NB! A tip for getting the Teams ID and the Channel ID:
Add the Team and Channel via the drop-down selector (flow step below). Then open the “peek code” to see what the ID’s of the teams are. If you don’t understand this step, just have a look at my video in the final post of the series 🎥

Back to the flow!

We update the get Opportunity with extra linked tables. This way we don’t have to do multiple retrieves, and only get the fields we need from the linked tables.

parentaccountid($select=name), owninguser($select=fullname, internalemailaddress), owningbusinessunit($select=saleswin_teamschannelid,saleswin_teamsid)

After we update the opportunity as closed with our Custom Action “close opportunity”, we check if the close dialog wanted to notify the team.

Then we need to get the @mention tag for the given user that made the sales. Here I am using the email address from the SystemUser table we are getting from the Opportunity extended table.

Finally, we post the Adaptive Card to Teams and behold the wonder of the adaptive card!! 💘

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.2",
    "body": [
        {
            "speak": "Sales Morale Boost",
            "type": "ColumnSet",
            "columns": [
                {
                    "type": "Column",
                    "width": 8,
                    "items": [
                        {
                            "type": "TextBlock",
                            "text": "🚨WIN ALERT🚨",
                            "weight": "Bolder",
                            "size": "ExtraLarge",
                            "spacing": "None",
                            "wrap": true,
                            "horizontalAlignment": "Center",
                            "color": "Attention",
                            "fontType": "Default"
                        },
                        {
                            "type": "TextBlock",
                            "text": "@{outputs('GetOpptyInfomation')?['body/name']}",
                            "wrap": true,
                            "size": "Large",
                            "weight": "Bolder",
                            "horizontalAlignment": "Center"
                        },
                        {
                            "type": "ColumnSet",
                            "columns": [
                                {
                                    "type": "Column",
                                    "width": 25,
                                    "items": [
                                        {
                                            "type": "TextBlock",
                                            "text": "🏠 Kunde",
                                            "wrap": true,
                                            "size": "Large",
                                            "weight": "Bolder",
                                            "horizontalAlignment": "Right"
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "💲 Verdi",
                                            "wrap": true,
                                            "size": "Large",
                                            "weight": "Bolder",
                                            "horizontalAlignment": "Right"
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "👩‍🦲 Selger",
                                            "wrap": true,
                                            "size": "Large",
                                            "weight": "Bolder",
                                            "horizontalAlignment": "Right"
                                        }
                                    ]
                                },
                                {
                                    "type": "Column",
                                    "width": 50,
                                    "items": [
                                        {
                                            "type": "TextBlock",
                                            "text": "@{outputs('GetOpptyInfomation')?['body/parentaccountid/name']}",
                                            "size": "Large",
                                            "weight": "Bolder"
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "@{outputs('GetOpptyInfomation')?['body/actualvalue']}",
                                            "weight": "Bolder",
                                            "size": "Large"
                                        },
                                        {
                                            "type": "TextBlock",
                                            "text": "@{outputs('Get_an_@mention_token_for_a_user')?['body/atMention']}",
                                            "weight": "Bolder",
                                            "size": "Large"
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "Image",
            "url": "@{body('Parse_JSON')?['data']?['images']?['original']?['url']}",
            "horizontalAlignment": "Center"
        }
    ]
}

Now, this is what an opportunity close dialog should look like!! 🙏🏆🌟🎉

Custom Page – Open Custom Page with Ribbon Button

I am using Dynamics 365 as an example, but the process will be the same for Power Apps – Model Driven. Only difference is that Dynamics 365 has the Opportunity table that we are wanting to use.

If you want to learn more about Custom pages I suggest you look at the following posts:
Scott Durrow
Lisa Crosby
MCJ
Microsoft Custom Pages

I have also added the simple button setup to Github, if you just want to give it a go.
👉DOWNLOAD SIMPLE BUTTON HERE👈

Creating an app and adding the button

Start off by adding an app to a solution and giving it a proper name. In my case, I am choosing Sales Win, because I am creating a simple app for everyone to see the functionality. You could of course just add this to your existing app if that is what you want to do.

For the tricky part, you need to open the Command Bar. This is essentially Ribbon Workbench jr😉 In time I would only imagine that most of the Ribbon Workbench would be available here, but we are probably still a few years away from a complete transition here.

Choose the main form for this exercise, and then create a new Command. Command is actually a button. Why it’s called Command I’m not sure as we all are used to add buttons to a ribbon🤷‍♂️

On the right side, you can add an image, and I usually find mine through SVG’s online.
SVG’s for download <- a blog post I wrote about the topic. Add this as a webresource.

Now, we are going to have to create some JavaScript. It’s actually the only way to open a Custom Page. The JavaScript is pretty “simple”, and I will provide you with the copy-paste version.

JavaScript

🛑BEFORE YOU STOP READING BECAUSE OF JAVASCRIPT🛑

I will provide the JavaScript you need. Unfortunately, you will still need to understand how to copy-paste some script for stuff like custom pages to work.

The only parameter you have to change here if you are creating everything from scratch is:
name: “saleswin_saleswin_c0947” <- replace with the name of your custom page.

function CloseWON(formContext) {
    //Get Opportunity GUID and remove {}
    var recordGUID = formContext.data.entity.getId().replace(/[{}]/g, "");
    // Centered Dialog
    var pageInput = {
        pageType: "custom",
        name: "saleswin_saleswin_c0947", //Unique name of Custom page
        entityName: "opportunity",
        recordId: recordGUID,
    };
    var navigationOptions = {
        target: 2,
        position: 1,
        width: {value: 450, unit: "px"},
        height:{value: 550, unit: "px"}
    };
    Xrm.Navigation.navigateTo(pageInput, navigationOptions)
        .then(
            function () {
                // Called when the dialog closes
                formContext.data.refresh();
            }
        ).catch(
            function (error) {
                // Handle error
                alert("CANCEL");
            }
        );
}

This JavaScript opens up a custom page and sends in a GUID parameter (look at PageInput) to use within the page. This is just how Custom Pages work, so don’t try to do any magic here!

Other examples of how to load a custom page:
Microsoft Docs Custom Page

Hide-Show button

It’s important to hide or show the button at the correct times, and that is why you have to add logic. With the following function, the button is only visible when the Opportunity is in edit mode. When creating a new Opportunity you will not see this button.

Self.Selected.State = FormMode.Edit

Add a new page to your solution

A custom page is a lot like a Canvas App, but it’s not exactly the same. Not all functionality is the same as a Canvas App, so you need to get familiar with it first.

The first thing I noticed was the lack of multiple screens.

It seems not impossible to add more screens, but Microsoft has hidden this feature. The reason seems to be related to isolating a Screen to be a specific application. Might make sense, but not for my use case. It does make somewhat sense because a Custom Page can be opened from everywhere within Model Driven Apps. It’s actually not tied to anything (entity) at all. If you need to turn it on: 👇

Please don’t judge this Canvas App ATM. It will only get better over time 😂

I added labels and text boxes without any logic to them yet and added a data source for Opportunities. This is all for the next step of our configuration of the Sales Win dialog.

Last step (maybe the most important one)

We now need to add the custom page to the APP.

Make sure you UNCHECK the “Show in navigation”. Otherwise, you will see this page as a navigation option on the left side like account, contact, oppty etc.

Finally, publish in the ribbon editor

What have we achieved so far?

Once the button is pushed, the Custom Page loads. 🙏👍🎉

Ribbon Button – Custom Page / Dialog

The deprecation of Dialogs has been discussed WAAAY too many times, and I still feel there is a gap for simple dialogs that would do lots of magic. A while back Microsoft introduced Custom Pages as one option to solve this missing piece, but simplicity is just not there yet.

I have been reviewing lots of great material from fellow MVP’s to study up a bit on the topic
MCJ – Custom Page updating Model Driven app
Scott Durrow – Adding logic to the new button configurator
Lisa Crosbie – Creating custom page

But I can’t quite shake the feeling that it’s still pretty tech-intensive to be able to create a Custom Page and call in from Dynamics. You need to have a decent understanding of the following:

  1. Creating a ribbon button in the new app configuration (easy, but adding commands not so easy)
  2. Javascript to actually start the Custom Page (not for everyone)
  3. Canvas App configuration (I am not a front-end type of guy, and hate having to start with a blank slate every time).
  4. Power FX for the showing of a button + updating whatever you are doing in the canvas app back to the model-driven app.

All in all, I would say that this is probably what you can expect a Dynamics/Power Apps consultant to understand, but it is not given that everyone feels comfortable while configuring. To be honest, Ribbon Workbench isn’t easy without a few tutorials either, but one gets better over time. (did anyone ever get the invert of a true/false statement right the first time?😂).

What to do?

Let’s just get to the bottom of the real issue. How to solve the problem of the Custom Page with a button and at the same time created a great way for sales to have a lot of fun!😁

Over the next weeks, I will start to publish a series of Custom Page and Sales, to showcase what you can do to improve Sales morale and adoption

Every post will be shown on the new Sales Page that I have “Win Notification” so stay tuned!!

The full solution will be available for download in the end.

AI Builder + Lobe

During the recent Arctic Cloud Developer Challenge Hackathon I was playing around with AI Builder for the first time. The scenario we were going to build on there was the detection of Good guy / Bad guy.

The idea was that the citizens would be able to take pictures of suspicious behavior. Once the picture was taken, the classification of the picture would let them know if it was safe or not.

For this exercise I would use my trusted BadBoy/GoodBoy nephew toys:)

Lobe

To start it off I downloaded a free tool called Lobe. www.lobe.ai . Microsoft acquired this tool recently, and it’s a great tool to learn more about object recognition in pictures. The really cool thing about the software is that calculations for the AI model are done on your local computer, so you don’t need to setup any Azure services to try out a model for recognition.

Another great feature is that it integrates seamlessly with Power Platform. Once you train you model with the correct data, you just export it to Power Platform!👏

The first thing you need to do is have enough pictures of the object. Just do at least 15 pictures from different angles to make it understand the object you want to detect.

Tagg all of the images with the correct tags.

Next step is to train the model. This will be done using your local PC resources. When the training is complete you can export to Power Platform.

It’s actually that simple!!! This was really surprising to me:)

Power App

Next up was the Power App the citizens were going to use for the pictures. The idea of course that everyone had this app on their phones and licensing wasn’t an issue 😂

I just added a camera control, and used a button to call a Power Automate Cloud Flow, but this is also where the tricky parts began.

An image is not just an image!!!!! 😤🤦‍♂️🤦‍♀️

How on earth anyone is supposed to understand that you need to convert a picture you take, so that you can send it to Flow, only there to convert it to something else that then would make sense???!??!

Image64 and Power Automate – What a shit show

After asking a few friends, and googling tons of different tips/trics I was able to make this line here work. I am sure there are other ways of doing this, but it’s not blatantly obvious to me.

Set(WebcamPhoto, Camera1.Photo);

Set(PictureFormat,Substitute(Substitute(JSON(WebcamPhoto,JSONFormat.IncludeBinaryData),"data:image/png;base64,",""),"""",""));

'PowerAppV2->Compose'.Run(PictureFormat);

The receiving Power Automate Cloud Flow looked like this:

I tried receiving the image as a type image, but I couldn’t figure it out. Therefore I converted it to a Base64 I believe when sending to Flow. In the Flow I again converted this to a binary representation of the image before sending it to the prediction.

The prediction on the other hand worked out really nice!! I found my model that I had imported from Lobe, and used the ouputs from the Compose 3 action (base64 to binary). I have no idea what the differences are, but I just acknowledge that this is how it has to be done.. I am sure there are other ways, but that someone will have to teach me in the future.

All in all it actually worked really well. As you can see here I added all types of outputs to learn from the data, but it was exactly as expected when taking a picture of Winnie the Poo 😊 The bear was categorized as good, and my model was working.

Why Lobe?

One can wonder why I chose to use Lobe for this, when the AI Builder has the training functionality included within the Power Platform. For my simple case it wouldn’t really matter what I chose to use, I just wanted to test out the newest tech.

When working with larger scale (numbers) of images, Lobe seems to be a lot easier for the importing/tagging/training of the model. Everything runs locally, so the speed of training and testing is a lot faster also. It’s also simple to retrain the model an upload again. This being a hackathon it was important to try new things out 😊

More about AI builder

I talked to Joe Fernandez from the AI builder team, and he pointed me to some resources that are nice to checkout regarding this topic.

https://myignite.microsoft.com/sessions/a5da5404-6a25-4428-b4d0-9aba67076a08 <- forward to 11:50 for info regarding the AI Builder

https://youtube.com/watch?v=MQQmDUCufS8 <- Lobe