NO ADMIN REQUIRED: Launch your canvas PowerApp from a Dynamics 365 Record
My latest canvas PowerApps creation provides a streamlined interface for managing “technical close plan” records in Dynamics 365 (set of configured entities associated with Opportunities). I built this app for myself and my peers to spend less time navigating between screens when building out our close plans so that we could have timely and accurate close plans visible to the whole pursuit team.
I estimate a time savings of a few minutes per deal per week. Over time that really adds up. Also, there’s a great peace of mind that I get personally knowing that I’m on top of it.
The only trouble is, I typically work with records inside of Dynamics, and didn’t want to have to jump out to a new browser window (or grab my phone), open the PowerApp, search for the specific record, etc.. That would chew into the time savings too much for my liking.
Why not just embed a PowerApp in the record form or add a menu button?
Unfortunately, both of those assume you have System Customizer or Administrator access to the environment. That’d be a great way to go, but I’m just a regular old user this time—and I don’t have an “in” with the admin either.
I didn’t want to recreate the saved Opportunity lists (system and personal views)…because I’m not a fan of reinventing the wheel inside of my apps, especially when I’m using the Dynamics 365 or CDS connector.
So I built my PowerApp with the assumption that I would spoon-feed in a specific Opportunity record through some other means (with some TBD level of automation).
Then I built a bookmarklet
“What’s a bookmarklet?” You know what a bookmark is in your browser: click a link and go to a website. A bookmarklet looks like the same thing, except when you click, it runs a little script to do something.
In my case, the bookmarklet finds the record GUID based the page I have open, then opens my PowerApp in a new window and passes in that GUID as a parameter.
I couldn’t find something readymade, but I did borrow the script to get the GUID. Big thanks to Benjamin John, who published a couple of blogs with a bunch of Dynamics 365 bookmarklets.
Handling the parameter
When the PowerApp is launched, specifically when the first screen loads, I use a function to check for the parameter and store it as a global variable:
The second function (the If… after the “;”) checks to see if the parameter was there and the app navigates to the details screen. There are a bunch of ways to do this, so I picked one that’s overly complicated but fun to look at. Oh the joyous freedoms of being a Citizen Developer 😉
Conclusion and call for collaborators
All in all, this was a couple of hours from initial research to final product and it’s already saved me a bunch of time in accessing the right record from my PowerApp. It also made me think back to a time before I had Admin privileges in most environments I touch. That’s a fun and creative part of the problem-solving brain that I was happy to say hello to again.