Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Simple power apps button to run flow, with inputs

(0) ShareShare
ReportReport
Posted on by 72

Hi All

 

I am trying to make a simple app with some inputs that are connected to a flow. I've not used any forms, and the only data source it is connected to is the Accounts in Dataverse, and the flow itself. I made the flow in Power Automate first, using the trigger "Power Apps V2", asking for some text inputs, an email, a yes/or question and a text input with choices. Then I made the Power App, which is just some text input fields, a combo box connected to the Accounts data for the email, a toggle for the yes/or and a dropdown. 

MelBo_1-1702365203249.png

 

So, I put a little Submit button there, and in the button in OnSelect I put:

FlowName.Run(Title.text,Description.text,Email.email,Nextone.boolean,Choice.text);

And that comes up with an error.

 

I think the problem is the ".email" and ".boolean" commands, but I am not sure what they should be. The suggestion, when I am typing in OnSelect, is to put email and boolean there. 

MelBo_0-1702365051044.png

That last one, listed as text_4 in the picture, is marked as optional in the flow, and I'm honestly not sure how to write that in the app. It certainly doesn't seem to want Name.text in curly brackets. Well, if it's a problem it being blank I could add a default value of "N/A" or something, that's not a problem.

 

Can anyone help me with this run command? How should I be writing this?

 

Thank you very much for your help.

  • Verified answer
    MelBo Profile Picture
    MelBo 72 on at
    Re: Simple power apps button to run flow, with inputs

    Oh, somehow I have fixed it!

     

    The combo box, I changed SelectMultiple to false (it's true by default, I guess), and then changed the field that it searches the data set from Account Name to Email. Here's me just trying everything at this stage, ha. And then changed the formula in the Submit button's OnSelect to Approver.SelectedItems.Email. I guess I needed to be more specific? 

    That left the one which was showing up as a record, which turned out to be the dropdown choice. I just changed it to Choice.SelectedText.Value. I don't think I changed anything else. And it seems all the errors just cleared up! 

     

    Well, I don't know, I guess sometimes you just have to work at it until you get it, right?

  • MelBo Profile Picture
    MelBo 72 on at
    Re: Simple power apps button to run flow, with inputs

    Well, "Email" isn't what it is called, I'm trying to keep it simple. I think I put "Approver" as the name of the combo box (so, Approver.SelectedItems), and the same for the input in the Power Apps V2 trigger, which is an email format. It's supposed to be the manager's email address.

    MelBo_0-1702430734958.png

     

    So, in Power Automate, it asks for an email address input from Power Apps, and the response should come from this combo box. If that's a problem, I can change it from a combo box to a text input, I just thought they would prefer to just choose a name from the data set, rather than just type it and risk mistakes.

  • VasileR Profile Picture
    VasileR 298 on at
    Re: Simple power apps button to run flow, with inputs

    Lets see what is this: Email.SelectedItems

  • MelBo Profile Picture
    MelBo 72 on at
    Re: Simple power apps button to run flow, with inputs

    Hi VasileR, thank you for replying.

     

    I think I have sorted out some of the problems. Please note, some of the information is just an example, as there may be information I shouldn't be sharing. 

    I have put the following in OnSelect:

    FlowName.Run(Title.text,Description.text,Email.SelectedItems,Toggle.value,Choice.SelectedText,FileNo.text,{text_4:RefNo.text})

     

    This is returning the errors:

    • Invalid argument type (Table). Expecting a Text value instead.
    • Invalid argument type (Record). Expecting a Text value instead.
    • The function 'Run' has some invalid arguments.

    I'm not sure which ones are causing the errors, but it's probably either the combo box, toggle or the dropdown. What arguments should I put for them?

     

    Thank you for your help.

     

  • VasileR Profile Picture
    VasileR 298 on at
    Re: Simple power apps button to run flow, with inputs

    Hi @MelBo ,

    It seems your flow expects 7 parameters, so you need provide values for all of them, or remove from the flow the ones that are not needed.

    FlowName.Run(Title.text,Description.text,Email.email,Nextone.boolean,Choice.text);     <- 5 parameters only here

     

    Also, the last parameter need to be entered in the form:

    FlowName.Run(Title.text,Description.text, ......(rest of params here)....,   {text_4: Choice.text} );

     

    Hope this helps

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard