web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to use a flow to t...
Power Apps
Unanswered

How to use a flow to trigger actions on a table

(0) ShareShare
ReportReport
Posted on by 51

Hi,

 

I've got a table "incident" having three columns "severity", "impact" and "priority" (number type).

These 3 columns are look up columns on three tables having the same name than the columns.

I've got another table (priority_impact_severity) that gives the priority depending on severity and impact

Example : priority = 1 corresponds to impact = 1 and severity = 1

 

I'm using model driven apps.

In my incident form I would like that priority would be automatically populated based on values populated in impact and severity fields (by querying the table priority_impact_severity). As I understood, one solution could be to use a flow. The problem is that I don't know how to run the query I mentioned above in my flow).

 

1) Is the flow the best solution to my problem ?

2) How can I configure my flow to populate automatically priority field based on impact and severity (and querying table priority_impact_severity) ?

 

Could you please help me ?

 

Frederic

I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @fred_05100,

    To answer your specific questions:

    1. Yes, flow is the typical and most common low-code approach to auto-populate values on a row. Note that it will run in the background (aka asynchronous) so it will not be real-time and might take a few seconds to see the updated values. The same can be achieve with Dataverse plugins and JavaScript, but if it can be async then cloud flow is preferred.
      You can also use Formula (Power FX) columns and refer to the impact and severity lookups to determine the priority. Might be worth to have a look as it can be a clean and easy solution: https://learn.microsoft.com/power-apps/maker/data-platform/formula-columns?WT.mc_id=DX-MVP-5004271 

    2. The flow would need to trigger on create of incident and on update of impact and severity columns. Use the "Added or Modified" change type. Would look something like this but with the right table and column names:
      EricRegnier_0-1698138117755.png

       

      You need to check that these columns contain data and if not set the priority back to empty.
      To find the priority on table priority_impact_severity you simply need to use the List Rows action with a similar type of filter using the correct table and column names:
      EricRegnier_1-1698138198491.png
      Important: when accessing lookup columns, filter need to follow format "_columnname_value". Eg: "_severity_value"

      Then to update the priority, use the "Update a row" action and reference the priority retrieved from the previous List rows action. Set the Row ID to the incident ID from the trigger:
      EricRegnier_2-1698138302419.png

       

    Hope this helps!

  • Jonathan Manrique Profile Picture
    2,687 on at

    Hello,

    First of all, we must know how you want the processes to run synchronously or asynchronously, depending on this we can use one or another solution.

    In case you understand what you want to do with flow (Power Automate), the first thing you should know are the triggers, in this case we will use the one when a row is added, modified or deleted.

    Then you must tell it when you need it to fire (when the value of a column changes), so from what I see it should fire once the impact and gravity fields are filled, so this should be the column selection.

    Then it has a filter and there you must place a filter so that it is only executed if it meets those conditions, that is. If for example impact and gravity are filled

    To answer you,
    1) for me the best solution is to make a javascript function, but if you don't want to use code you could use a Flow, only the changes will not be seen until the record is saved, however with JS yes
    2) To fill it with PA, then you must add an action to update data and add the value, in this case having several options, you must execute a switch, and within the switch another, for the combination of two values.

    I would recommend using JS, it is faster and easier.

     

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

    You can accept more than one post as a solution

     

  • fred_05100 Profile Picture
    51 on at

    Hi Eric, thanks

    I'm going to try it.

    I will tell you.

  • fred_05100 Profile Picture
    51 on at

    Hi,

    Thanks for your help.

     

  • fred_05100 Profile Picture
    51 on at

    Hi,

    I tried the following but it doesn't work :

     

    fred_05100_0-1698177422796.png

    fred_05100_1-1698177537262.png

    Error detail :

     

    fred_05100_2-1698177779511.png

     

    Do you have any idea ?

     

  • ivan_apps Profile Picture
    2,187 Moderator on at

    You have to use the field logical names, which are similar to the schema name (but not the display name). Assuming you created the tables you mentioned, the table and columns each have a ‘prefix’ that matches your solution publisher or the default environment publisher. Sometimes it’s a random set of letters and numbers or ‘new_’. If you defined your own publisher your fields could be prefixed with whatever letters your want. Assuming your prefix is ‘new_’ your field names should be

    new_severite

    new_impact

     

    Your trigger is failing because it can’t find the field name so try adding the prefix and try again. If you want to create Odata queries easily, you can use Guido Preite’s Dataverse Rest Builder and it will generate an Odata query by selecting fields in a nice UI. 
    https://github.com/GuidoPreite/DRB

     

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Bonjour @fred_05100, I can see that the field/column names are incorrect. All custom columns should have a prefix. Also your table name in the 2nd screenshot is wrong. You can find the physical table and column names in the Maker portal:

    EricRegnier_0-1698219035232.png

    EricRegnier_1-1698219072091.png

     

    Cheers

  • Jonathan Manrique Profile Picture
    2,687 on at

    Hello seeing the flow you are setting up, I would review again if it is the best option for what you are looking for at the level of business solution. When you enroll the final you run the risk that if the registration number is very large you will have performance problems and in total of the final recovered even when you are inserting a filter. Additionally, you will then have to make an application to everyone.

     

    If you approach your solution at the JavaScript level, you will only be working with the current registry and you will be able to control that it only executes on the on change of the attribute. I suggest you take another look at the requirement and consider whether Power Automate is the way to go. You can use a switch that will allow you to validate what happens when a particular case occurs. Another issue that you have to see is what happens, if as a user I select a value, but I make a mistake I want to delete it, then the flow will run twice and another alternative is that I let it delete the priority value and severity how the flow should respond

    Normally Power Automate is used to automate processes, for validation purposes it is better to use JavaScript

     

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

    You can accept more than one post as a solution.

  • fred_05100 Profile Picture
    51 on at

    Hi,

     

     tried the following :

     

    fred_05100_0-1698265595421.png

    I cannot make it work :

    1) naming tables with cr7a0_ before is refused

    2) Expression "cr7a0_id_impact eq impact (Valeur)" produced an error and I have no other choice than the following

    fred_05100_1-1698265896880.png

    What do I have to set on the right of "eq" in order to get values from the action "when a row is added modified or deleted ?

  • fred_05100 Profile Picture
    51 on at

    Hi,

    Finally, I'm going to follow the path you propose.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard