Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 0N+/hAfURyy+clEDrOBytM
Power Apps - Building Power Apps
Answered

Initiate Flow from Power FX Menu Button Model Driven App

Like (0) ShareShare
ReportReport
Posted on 14 Mar 2024 12:00:22 by 402

Hi everyone,

 

I have a use case for a user to initiate a Flow on selected records from a Model Driven App. I found @ScottDurow  @scottdurowMS 's excellent video on this topic (specifically the chapter on Power Fx Modern Command Grid Button), but when I get to the point of declaring the target columns in the Patch function in the Power FX statement, they do not appear in Intellisense.

 

Things I have tried:

 

1. Add two columns, one a Date/Time format and one a text format, in case it was a column type issue.

2. Add the columns to the appropriate View for the Table.

3. Publish All Customisations.

4. Remove the Button I added to the Command Bar before I added the new columns. Add the button again, then try declaring the columns again in the Power FX statement.

5. In the Model Driven App, remove the appropriate Form/View for the target table from the App completely. Republish the App.

6. Ensure the two target columns mentioned in (1) have data for at least one record in the target table.

7. Wait 12 hours in case there was some latency.

 

It's very odd as Intellisense is showing the columns I originally had in the target table, but the columns I've added since to target the Patch statement will not show up despite everything attempted (listed above) so I can't progress.

 

I am using the Main Grid, not a Sub Grid as in Scott's video, but I can't see this would make any difference as the source data is the same.

 

Any help on this would be very much appreciated, thank you!

Categories:
  • pp365 Profile Picture
    402 on 18 Mar 2024 at 11:16:02
    Re: Initiate Flow from Power FX Menu Button Model Driven App

    Hi @parvezghumra , thank you very much for this - completely resolved the issue and really grateful for the clearly documented and explained response which has enabled me to move forward with building the solution.

     

    This will be a great reference point for the future and I'm sure this will benefit other users in a similar situation.

     

    Once again thank you very much for your time and expertise!

  • Verified answer
    Parvez Ghumra Profile Picture
    1,579 Super User 2025 Season 1 on 18 Mar 2024 at 10:44:19
    Re: Initiate Flow from Power FX Menu Button Model Driven App

    @pp365 You should be able to achieve what you want using a modern command as per Scott's YouTube video. To get intellisense to behave, I think you need to refresh the dataset that's associated with the 'Component Library' associated with your customised command bar. Follow these steps to do so:

    1. In the Modern Command Bar designer, click the 'Open component library' button:

    parvezghumra_0-1710757886342.png

    2. In the tab/window that pops up, click the Data icon in the left hand navigation strip

    parvezghumra_1-1710757969129.png

    3. Click the ellipses corresponding to your Dataverse table and in the context menu that pops up click the 'Remove' button

    parvezghumra_2-1710758111522.png

    4. Use the 'Add data' button to re-add your target Dataverse table

    parvezghumra_3-1710758191411.png

     

    5. Save and then Publish the updated component library using the buttons in the top-right

    parvezghumra_4-1710758263293.png

     

    6. If you then refresh your browser window/tab with the command designer, you should be able to reference your newly added columns in your PowerFx expression.

     

    I think you will need to follow these steps every time the schema of the table changes and you need to make use of those changed components in your PowerFx.

     

    In your response to your follow-up question, the JavaScript approach could also achieve the same outcome, but it's a more pro-code approach and so is more difficult to achieve. Scott's course is great and takes it one step further, writing TypeScript rather than JavaScript directly, which is best practice and has a whole heap of other benefits improving overall developer experience by catching errors at design time, standardised JavaScript generation, etc. It's a really advanced approach and requires quite a bit of setup and configuration. I've known of Scott's course for a while, and often dip into bits of it every now and again but have never run through it end to end, but definitely something I need to do.

     

    Hope this helps.

  • pp365 Profile Picture
    402 on 15 Mar 2024 at 15:00:21
    Re: Initiate Flow from Power FX Menu Button Model Driven App

    Also, if the Power FX route does not work, then it looks like I will have to go down the Javascript route. I have never needed to use Javascript. On @ScottDurow  @scottdurowMS 's original video he provides a link to a course (Building JavaScript Web Resources using TypeScript (develop1.net)) - but I will need a beginner's level course to get started on this.

     

    Has anyone completed this course and is it a beginner's level, or, can anyone recommend a "Javascript for Power Apps beginner's level course"? 

     

    Again thank you for your time.

  • pp365 Profile Picture
    402 on 15 Mar 2024 at 14:44:27
    Re: Initiate Flow from Power FX Menu Button Model Driven App

    Anyone? Could really do with some help here as this is a complete blocker. Thank you.

  • pp365 Profile Picture
    402 on 15 Mar 2024 at 07:33:42
    Re: Initiate Flow from Power FX Menu Button Model Driven App

    Hi all, can anyone offer any advice on this issue? Or, provide advice on a best practice way to achieve the desired outcome (running a Flow on the basis of one or more selected records in a Model Driven App)?

     

    No problem with achieving this a different way if it works and is stable for Production, although I have seen that other options involve Javascript which I know little to nothing about, so would need some explanation around this.

     

    Thank you very much for your time.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard