A uniform approach to Power Automate input parameters in the Power Apps trigger

This blog post is part of a 3-part series:

  1. Understanding default naming for Power Automate input parameters in the Power Apps trigger
  2. A uniform approach to Power Automate input parameters in the Power Apps trigger (this post)
  3. Using JSON to optimize Power Automate input parameters in the Power Apps trigger

In my previous blog post, I explained how Power Apps trigger input parameter names are generated based on the name of the action and the field it is used in. Since there are some drawbacks to the variety of names that are created this way, I want to share a uniform approach that I often use when working with a fixed set of input variables that I know is highly unlikely to change in the future.

The method

We know that an input parameter is generated using 2 parameters:

  1. The name of the action it is generated in
  2. The name of the field it is generated in

We can only control the first part, so to have a uniform naming, we should use one action that can generate different types of parameters within the same field. That action is “Initialize variable“. Using the “Type” field, you can differentiate between different types of parameters that can be passed by a Power Apps canvas app. The second part of the input parameter name will always be _Value (since this is the field that we generate the parameter in). You can then control the first part of your input parameter name by renaming the action before you generate the input parameter. That way, you have a uniform naming convention. Let’s take the same example parameters as in the previous blog post.

For the subject of the email and the title of the item we want to create, we can create a string parameter, for the ID we’ll use an integer. After adding three “Initialize variable” actions, filling in the name and type of the variable, we need to take two actions to create our input parameters for the flow:

  1. Rename the “Initialize variable” action to the name of the variable
  2. Add the “Ask in PowerApps” dynamic content in the initial value


The resulting input parameters will now have a name according to the following pattern: VariableName_Value. A uniform approach to input variables!

Itemld 
Name 
Itemld 
Value 
Itemld V 」 x 
ItemTitle 
Name 
ItemTitle 
String 
Value 
ItemTitle Valu x 
EmailSubject 
Name 
EmailSubject 
String 
Value 
EmailSubject Value x

The good and the bad

The great thing about using this approach is that all your input variables will show up using the same pattern in your app. When adding this flow to a Power Apps canvas app it’s easy to know what is expected in each of the input parameters thanks to these names.

Run(ltemld_Value, ItemTitle_Value, EmailSubject_Velue) 
Variableinputvariables . Runl

However, this is not a flexible solution. If tomorrow it is decided that the email is replaced by an approval, the input variable will still be called EmailSubject_Value. Or if the parameter is not used anymore in the flow, it will still be present and required as input parameter. When adding a new input parameter in your flow, you could have to remove and add the flow again in order to ensure that the changes on the trigger are picked up and your app doesn’t break.

Therefore, in the next and final blog post in this series I’m offering a flexible solution that addresses both these issues: Using JSON to optimize Power Automate input parameters in the Power Apps trigger.

2 thoughts on “A uniform approach to Power Automate input parameters in the Power Apps trigger

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: