Welcome back for Part 2 of Solutioning. If you missed Part 1 please check it out.
In this week’s discussion on enhancing your Power Platform solutions, we’ll be delving into the process of incorporating existing tables into your solution. Before we dive into the details, it’s essential to recognize that there’s no mystical formula for adding a component to your solution. This reminds me of a valuable lesson imparted by one of my colleagues, especially when discussing governance: “Just because we can, doesn’t mean we should.” This principle directly applies to the inclusion of tables in a solution. Simply having the ability to add every field from a table into your solution doesn’t automatically mean it’s the best course of action. Let’s explore this further.
Business Value
In the context of Power Platform solutions, adding an existing object to a table may not seem immediately impactful, but it holds significant value for your business.
Here’s a brief story to help illustrate this:
To better understand the importance of adding only the necessary fields to your table within a Power Platform solution, let me share a personal experience that highlights this point. It relates to that insightful phrase from my colleague. Here’s what happened:
I was working on a Power Platform solution—whether it was an app or a flow—in a development environment, preparing it for the transition to the testing phase. In the early stages of building the solution, I faced a crucial decision when incorporating an existing table into the solution. At that moment, I chose to select the ‘Include all objects’ checkbox without giving it much thought.
Little did I know, I unintentionally created a situation that would require some effort to resolve. As we all understand, time is valuable in business.
In a development environment, it’s not always easy to track who’s working on what, and how changes to a table schema might affect your deployment. Communication isn’t always perfect. To reduce risks and minimize errors, it’s a good practice to take some precautions.
In simple terms, this approach helps to prevent errors, leading to quicker issue resolution. This saves time, money, and the stress of figuring out why you’re encountering errors related to missing dependencies that you didn’t directly modify.
Adding existing table to solution
Within our solution, follow these steps:
Select “Add Existing.”
Choose “Table” from the options.
Pick the specific table you wish to work with.
Then, click on “Next” to proceed.
5. Now, go ahead and choose “Select objects.”
At this point, you’ll be presented with a list of all the objects that are currently part of the selected table.
Pick only the objects that you plan to include in your solution.
Then, click the “Add” button to add the selected objects.
On this screen, you’ll notice a count of the objects you’ve selected.
Go ahead and click the “Add” button to proceed.
You will now see that you have added your table to the solution
To view the contents of your table, click on it. (Please note that if there is data in the table, you’ll be able to see all the columns and data. However, these columns are not automatically included in your solution when you move it.)
Now, choose “Columns,” and you will only see the column or object that you added to the solution.
Thank you for joining us this week. In our next installment, we will continue to explore the world of solutioning. Our ultimate aim in solutioning is to lead into a discussion about Application Lifecycle Management (ALM). So, stay tuned for more exciting insights!
The Power Platform maker experience can seem like the Wild West. At any moment you can create a component that relies on other components and can create a disaster quickly.
In this series I’d like to cover some best practices, that I’ve seen over the past 5 years of working with the Power Platform – some lessons learned – such as – ‘DON’T BUILD IN THE DEFAULT ENVIRONMENT’ and other.
Solutions explained in a not so Microsoft way…A.K.A. – my way.
Imagine you have a kid with a room bursting with toys. It’s like a treasure trove of fun waiting to be explored. But hold on, it’s also a minefield! Stepping on a Lego here, tripping over something there – it’s an adventure you never signed up for. Sound familiar?
One fine day, you, the heroic parent, decide to bring order to this chaos. You’re on a mission to save your head and your feet from more unexpected encounters with toy-related perils. So, what’s your grand plan? You buy a container—a magical vessel that can hold all the toys.
In essence, a solution is your trusty container. It’s like that superhero utility belt, but for organizing digital goodies. You can get as fancy as you want with how you organize your toys – perhaps all the trucks go in one, Legos have their VIP section, and stuffed animals chill in another. Each container’s job? To amp up the fun!
Now, you might be thinking, “Why not just cram them all into one mega-container?” Well, my friend, think about it this way: when a child wants to supercharge their fun, they focus on one toy at a time, right? Or maybe you swap out the old for something shiny and new—a fantastic upgrade! We divide our solutions because not everything needs an upgrade. Remember, the bigger the toybox, the heavier it is to move.
So, there you have it – solutions are like these nifty toy containers, but for the Power Platform. They house all the bits and bobs that make the digital world go ’round. You can move them around effortlessly, using pipelines or a little digital muscle. And how you put these solutions together? Well, that’s where your creativity kicks in.
In a nutshell, solutions are your secret sauce, your digital playroom organizers. They’ll make your life as a Power Platform Developer/Maker a breeze. So go ahead, dive into the world of solutions, and let the fun (and efficiency) begin! Toys sold separately… 🚀
Creating a Solution
First things first, head on over to the Power Platform environment. You can do this by simply going to either make.powerapps.com or make.powerautomate.com – choose the one that suits your needs.
Now, on the left-hand side, look for and click on the “Solutions” option in the navigation bar.
Here comes the fun part – hit the “+ New Solution” button. That’s the one that gets the ball rolling for creating your new solution.
In the form that pops up, give your solution a cool name. If you’re not cool with the default publisher for your solution, no worries – you can make a new one. It’s actually a good idea to give it a name that makes sense. We can cover the publisher in further posts until then click “The Link” to view “Solution Concepts”… The Link
Finally, just click “Create,” and there you have it – a solution.
Extending our exploration of auditing within Dataverse, we’ll employ the ‘HTTP With Azure AD’ action in Power Automate to retrieve the previous value of a modified record.
Before proceeding with this tutorial, it’s essential to have auditing enabled in your environment. If you’re not sure how to do this, please consult the first episode in this series for step-by-step guidance.
Business Value
“Garbage In, Garbage Out.” You’ve probably heard the importance of data integrity. Ensuring data consistency and quality is pivotal because it lays the foundation for reliable analytics and decision-making. Audit trails serve a dual purpose: they not only make users responsible for their actions within the system but also offer invaluable data points for analysts to identify trends, facilitating smarter business decisions.
Framework
Solution
In this tutorial, our focus will primarily be within the context of a solution. A solution serves as a container where we organize and house the components related to the digital transformation we are undertaking. While we won’t delve into an exhaustive explanation, it’s important to understand that solutions provide a structured framework for managing and deploying our project’s components.
Datasource
With auditing activated in our setup, go ahead and pick a table to experiment on. For this demonstration, I’ve selected the “Accounts” table from Dataverse’s Common Data Model.
Retrieve Environment URL
To access the Environment URL required for our flow, navigate to the ‘Power Platform Admin Center.’ This URL is crucial for configuring the flow within its respective environment.
Upon reaching the Admin center, follow these steps:
Navigate to the left-hand side navigation menu.
Select “environments.”
Choose the specific environment you are currently working in.
This will allow you to access the environment URL needed later on.
Copy the environment URL and paste it for use later on.
Environment Variable
In our workflow, especially for the ‘HTTP with Azure AD’ action, we will create an environment variable. This variable will store the URL specific to our environment, which we will subsequently incorporate into the request URL for this action.
By leveraging environment variables, you’re not just streamlining your current workflow; you’re future-proofing your solution. When the time comes to move your solution to a new environment, you can easily update these variables to align with the context of the new environment. This ensures that your solution maintains its agility and effectiveness, regardless of where it’s deployed.
In your solution, follow these steps to create a new environment variable:
Select “+New.”
Click on “More.”
Choose “Environment Variable.”
This will initiate the process of creating a new environment variable within your solution.
For the form, please complete it as follows (note that there is some flexibility with the Display Name and Description):
Copy and paste the previously retrieved environment URL into the “Default Value” field.
Save the changes.
This step ensures that the environment URL is properly integrated into the flow, facilitating the seamless configuration of your flow.
Connection Reference
Before we proceed to configure our flow, there’s one more crucial task to enhance its robustness. We need to create a connection reference for the ‘HTTP with Azure AD’ action. This connection reference serves a similar purpose to the environment variable by enabling the flow to seamlessly transition to a new environment while establishing a connection to the resources within that environment. This step ensures the continuity and adaptability of our flow across different environments.
Inside our solution, follow these steps to create a connection reference:
Select “+New.”
Click on “More.”
Choose “Connection Reference” to open the connection reference form.
This form will allow us to establish a connection reference for our flow, enhancing its flexibility and portability across different environments within the solution.
In the connection reference form, follow these steps:
Name the connection reference.
Optionally, add a description.
From the connector dropdown, select ‘HTTP with Azure AD.’
In the connection selector, click “+ New connection” to create a new ‘HTTP with Azure AD’ connection. This action will open a new tab where you can set up the connection details for ‘HTTP with Azure AD.’
In the new tab for connection details, follow these steps to create our connection:
Select ‘Connect directly (cloud-services).’
Enter the environment URL that we retrieved from the admin center earlier into the “Base Resource URL” field.
Enter the environment URL in Azure AD Resource URI (Application ID URI) field.
Select Create to create connection.
Creating connection
5. Next, you will be prompted to select an account to establish the connection with. Once you’ve chosen the account, the connection will be created, solidifying the link between your flow and the ‘HTTP with Azure AD’ action.
Return to the tab with the connection reference form and follow these steps:
Select the refresh button to ensure your newly created connection is visible.
Choose your newly created connection from the list.
Finally, select “Create” to create the connection reference.
This step will integrate the connection reference into your solution.
Flow
Time to build a flow!
Within your solution, proceed as follows:
Select “New.”
Choose “Automation.”
Select “Cloud Flow.”
Opt for “Automated” to set up your flow.
You will be directed to a screen where you can name your flow and select its trigger.
For the purposes of this demo, you’ve named your flow ‘Account Updates’ and selected the Dataverse trigger, specifically, ‘When a row is added, modified, or deleted.’ Now, proceed by selecting “Create” to start configuring your flow.
In the trigger configuration, set the following parameters:
For “Change type,” select “Modified.”
For “Table name,” choose “Accounts” or the table of your choice.
Set the “Scope” to “Organization.”
These parameters will define the trigger conditions for your flow, ensuring it activates when a row is modified in the specified table.
Let’s add a new step to your flow. Follow these steps:
Search for “HTTP with Azure AD.”
Select “Invoke an HTTP request.”
To ensure that your connection reference is properly selected, follow these steps:
Click on the three dots in the top right corner of the “Invoke an HTTP request” action.
Confirm that your connection reference is correctly chosen. This step is essential for maintaining the flow’s integrity if you decide to migrate the solution to a different environment.
To configure the “Invoke an HTTP request” action, follow these steps:
For the HTTP method, select “GET.”
In the URL field of your request, use the following template:
{Environment Variable URL}/api/data/v9.2/RetrieveRecordChangeHistory(Target=@target,PagingInfo=@paginginfo)?@target={'@odata.id':'[table plural name](GUID of the updated record from our trigger)'}&@paginginfo={"PageNumber": 1,"Count": 1,"ReturnTotalRecordCount": true}
Replace the placeholders with the appropriate values:
{Environment Variable URL} should be replaced with the actual environment variable you created.
[table plural name] should be replaced with the name of the table (in plural form).
(GUID of the updated record from our trigger) should be replaced with the GUID of the updated record obtained from your trigger.
This configuration sets up the HTTP request to retrieve the record change history based on the trigger’s parameters.
Make sure to validate and adjust the URL according to your specific environment and requirements.
For the action headers, follow these steps:
Switch to text mode by selecting the ‘T’ icon.
Copy and paste the following headers configuration:
Foreword, foreword, foreword. A foreword written by the author. Ok…I like to share things that I’ve learned in practice for a client, things that I think are interesting concepts, and things that I think will extend the Power Platform. I like to extend the Power Platform to users that aren’t in the tenant, to provide users and clients with tools that they are familiar with…Insert custom connector, Power Apps Portal, webhooks, MS forms, emails…yada…yada…yada, this could’ve turned into the song that doesn’t end, and yes it does go on and on my friend….
Today, we will focus on the extensibility via the Custom Connector utilizing a tool that I like to use because it has a free tier that is more than useful — ClickUp. In short I use ClickUp the way that someone would use MS Planner, Monday.com, Jira, and the like. I’ve also worked with clients that use it as a ticketing system.
Because I work with the Power Platform, I thought that it would be neat to merge these two swell technologies.
First things first…you will need a ClickUp account, if you don’t have one visit https://www.clickup.com and get signed up or if you have a trusting friend ask to use theirs…
Lets begin…
First open notepad, a text editor, or have a paper and pencil handy. Honestly, I’d go with the copy and paste electronic method because the things that you are going to copy and paste will be pretty long…fine…nix the paper and pencil.
Now…
Once you’ve signed into your ClickUp Dashboard copy the team id from the address bar and paste it into notepad
Your team id will be after the first forward slash –indicated by the orange rectangle
Next go to settings and click on Integrations
Click on ClickUp API
Create App
Enter the name of your app and the redirect uri then select Create App. I use the standard redirect uri that we get back from Power Platform when we create a connector global.consent.azure-apim.net. It’s perfectly fine if you use it too. I promise I don’t own it…no rights whatsoever.
Once you successfully create your app, you will be provided with a Client ID and Client Secret, please copy and paste these to notepad as well.
Now the fun begins, it really doesn’t take long to go through the next steps…maybe. If you do this right, you will create a custom connector to ClickUp.
Documentation is your best friend, fortunately for us, ClickUp has documentation on how to work with their API. In a new tab/window navigate to https://clickup.com/api to see the docs and different actions that are at your disposal.
The first thing that we will need to do is generate a code for if you used the redirect uri that I provided in the previous step copy and paste the following address into your address bar, you will need to add your Client ID to the address
After executing the previous step you will be prompted to connect to your workspace. If you’ve done everything right you will see the name of your app in the prompt. Select the workspace and click connect.
Once you select connect you will navigate to a new page. Please copy the code from the address bar and paste it into notepad.
Next we will generate our authorization code or API Key. You will need the Client ID, Client Secret, and the code from the previous step.
Scroll down to the response body and copy the authorization code then paste it to notepad
Next navigate to make.powerapps.com
Select Data
Select Custom Connectors
New Custom Connector
New From Blank
Name your connector
Click Continue
Next we will go through setting up general information for our connector. You can choose to upload an image for your connector or add a description – either not required. However, you will need to enter the host url and the base url.
The host url is api.clickup.com and in the base url input insert a forward slash /
Next we will set up the security for our connector and this is one of the easier steps.
The Authentication Type will be API Key, the value for Parameter Label and Parameter Name is “Authorization”, and the Location will be “Header”
Next we will create our connector definitions by navigating to the Definition tab.
Select New Action from the left pane.
In the General box the only required field is the operation id. I tend to name this something similar to whatever action is being performed.
Next we will want to select Import from sample in the Request box
For this tutorial, the action that we will be performing is getting all of the Workspaces in our team
Please select Get from the radio options.
Next enter the following url as is into the Url text input. We don’t want to hard code the team id into this we want to be able to access it from outside of the request by using curly brackets we create arguments that can be passed in from an app or flow.
Next select create connector to create the connector. Once the connector is created navigate to test here we will create our connection to the api.
Select New connection when prompted, enter the authorization code we created earlier, then create.
Once you click create you will be moved to the connections screen. if you’ve done it right you will see that you have a connection to the api.
Now lets go back to data>custom connectors > edit our newly created connector > test. In the GetSpaces box at the bottom of the page enter the team id into the text field and select test operation. If all goes well we will receive a 200 code and receive a JSON payload.
Copy the JSON payload and navigate to the Definition tab. In the response area select Add default response > paste payload into the body > import.
Finally update the connector. By adding this response we now have a schema for how our data is being returned and dynamic content to be used in our apps or flows once we import the custom connector into the process.
Now that we have the basic knowledge of how to create a custom connector for the ClickUp, feel free to see what other actions you can create. At the time of this publication I have 15 actions that I am using in an app. In the weeks to come I will share this with you.
Thanks for spending time with me. You could’ve been anywhere else on the world wide web, but you’re here with me…I appreciate that.