cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JosephBoland
Level: Powered On

Flow Run command has "invalid number of arguments" error for any parameters

I'm attempting to pass parameters to a flow that is the button action in a PowerApp.  The action is <flow name>.Run().  No matter what arguments I give to Run, I get an "invalid number of arguments" error.  This implies that no arguments are accepted.  Is this the case?  Other discussions of Run seem to indicate that it does accept arguments.  In that case, what am I doing wrong?  And if it doesn't accept arguments, how else can these be delivered to the invoked flow?

7 REPLIES 7
Community Support Team
Community Support Team

Re: Flow Run command has "invalid number of arguments" error for any parameters

Hi JosephBoland,

 

Your flow is triggered by PowerApps button, then what’s the following action? Please share a screenshot of your flow configuration.


To test this issue, I have created a simple flow. The Flow is triggered by PowerApps, the following action is “SharePoint – Create item”.


In the SharePoint list, I have several columns including Single Line of Text, Number, Date and Time.


In the flow, I select the dynamic content “Ask in PowerApps” for all the fields.


The following screenshot is the flow configuration of my flow.
3.PNG


On the app, add a button and other needed controls. Then configure the button’s OnSelect property as:

'PowerApp->Createitem'.Run(TextInput1.Text,Value(TextInput2.Text),DatePicker1.SelectedDate,DatePicker2.SelectedDate,Label1.Text,TextInput3.Text)


Specifying parameter to each column, I don’t get the error message you mentioned.

4.PNG

 

Please try again with it on your side and take this doc for a reference:
https://docs.microsoft.com/en-us/powerapps/using-logic-flows

 

If you are still having the issue, please show me more details to help reproduce this issue on my side.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
JosephBoland
Level: Powered On

Re: Flow Run command has "invalid number of arguments" error for any parameters

Hi Mabel,

 

As I understand your proposed solution, it does not work in my environment.  Screenshots are below; here's a description of the components:

 

  1. SharePoint online list called "Messages" with Message Title, Message Text, and Audience columns.
  2. PowerApps form with a "Send Message" button.
  3. Flow called "Send SMS Messages" that is triggered by the PowerApps form.
  4. The "Send Message" button's On Select action is "SendSMSMessages.Run()"
  5. It is not possible to add any parameters to the Run command.  Doing so results in the "Invalid number of arguments" error.

 

This shows the Run command when a Label control's Text property is added.  Same error with every other parameter I've tried.

 

PowerApps_Run_error.PNG

 

Here is a screenshot of the flow.  Note that another open issue with Microsoft, which apparently many others are having (see link below) is that Dynamic Content is not available for PowerApps.

Flow_PowerApps_no_dynamic_content_final.PNG

 

 

On the issue of missing "Dynamic Content" for PowerApps, see https://powerusers.microsoft.com/t5/Building-Flows/No-Dynamic-Content-Available-Ask-in-Powerapps-Mis....

KYamazaki0207
Level: Powered On

Re: Flow Run command has "invalid number of arguments" error for any parameters

Hi everyone,

 

Sorry if I'm a little too late, but I've been having this issue and just found the solution.  No tricks - it's pretty easy:

 

  1. Ensure the name of your flow matches the "Ask in Powerapps" Flow variable (all characters before the underscore) that you're trying to pass, i.e. if your variable's name is "Sendanemail_To," then your Flow must be named "Sendanemail"
  2. Check how many copies of the same variable exist as an option in your Flow by clicking on the variable and scrolling to the bottom of your variable option window that pops up.  The number of copies will determine the number of arguments that you must include in the Run command in PowerApps, i.e. if you have "Sendanemail_To, Sendanemail_To_1,Sendanemail_To_2" available, you'll need to include three arguments in your Run command.
  3. At this point you may have to force PowerApps to recogize the updated flow immediately by either or all: (a) restarting PowerApps, (b) turning the flow off and turning it back on,/re-doing the Flow from scratch or via copying the Flow and deleting the original, ensuring the remaining copy is named per step #1.
  4. In Powerapps, assign your Flow as usual, and format the Run command parameters per this example: Sendanemail.Run(Text1,Text2...) where "Text" is either a Label or TextInput (with ".Text" appended, of course) or if you'd like to pass text directly as a parameter, just include whatever text you need enclosed in quotation marks.  In my case, I can either pass an email address enclosed in quotes, an email address that's a DataCardValue/Label/TextInput, or User().Email if I wanted an email sent to the user.
  5. Lastly, make sure that your number of arguments matches the number of variables per step #2.  If you don't need that many variables, assign double-quotes ("") in place of the variable.
zeus
Level: Powered On

Re: Flow Run command has "invalid number of arguments" error for any parameters

This is still hit and miss for me. I have already done "ask in powerapps" twice and powerapps thinks the flow has no arguments. I get the error warning (triangle with exclamation) icon.

 

It takes a couple of tries, coming back and forth between the two apps to sync.Frustrating... It would be less frustrating if it tells you how many arguments is expected. 

leonunescouto
Level: Powered On

Re: Flow Run command has "invalid number of arguments" error for any parameters

I am having the same error, just created an one command flow to test the parameters and on powerapps, when calling the flow I get an error message saying that the flow has 0 expected parameters.     "Invalid number of arguments (Received: 1 ; Expected: 0)

 

on flow, I created a task to send a simple email and added the variable from dynamic contents / Ask in Powerapps on the subject line.

 

 

 powerapp

Flow

Rashaad_Compass
Level: Powered On

Re: Flow Run command has "invalid number of arguments" error for any parameters

I was having the same issues. 

Once I got PowerApps setup, I had to recreate the flow. 

That fixed the issues. 

The Flow was expecting 3 paramenters, even though it showed 1.

 

dimi
Level 10

Re: Flow Run command has "invalid number of arguments" error for any parameters

What helped for me was to add the variables in flow by "Ask in powerapps", after that in the PowerApps portal in Action => Flows => click on the Flow that is in the second section for it to connect to the Flow and than your parameters will be recognized. See screenshot. Hope this helps someone Smiley LOL 

 

Screenshot:

https://imgur.com/W8VjNDX

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 352 members 4,371 guests
Recent signins:
Please welcome our newest community members: