cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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?

11 REPLIES 11
v-yamao-msft
Community Support
Community Support

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.

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....

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
Advocate III
Advocate III

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. 

Anonymous
Not applicable

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
Frequent Visitor

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
Impactful Individual
Impactful Individual

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

 

 

365-Assist
Multi Super User
Multi Super User

I just had the same problem. Thanks to all the replies in this thread most gave me bits of solutions. Here is what I did to solve it.

 

  1. In the PowerApps remove the Button OnSelect Function Details

Annotation 2020-06-01 140549.jpg

2. In Power Automate removed the 'Update File Properties' Action

 

Annotation 2020-06-01 135526.jpg

3 In PowerApps - Removed the PowerAutomate Source

Annotation 2020-06-01 135851.jpg

4.  In Powerapps - Added in the Power Automate Source back

Annotation 2020-06-01 140115.jpg

 

5.In PowerApps - Added back the OnSelect Function

Annotation 2020-06-01 140929.jpg

 

6. In Power Automated added back the PowerApp fields

Annotation 2020-06-01 141047.jpg

 

I hope this helps someone.

kaiserjake
Regular Visitor

Can anyone spot the error in this command? PowerApps is saying Invalid Number of Arguments, received 2, expected 1.

 

Set(varFileLink, UploadtoCDTSIOISharePointSite.Run(Last(AttachmentControl.Attachments).Name, varBase64Only).sharepointfilelink)

marcoswnunes
Frequent Visitor

Alright, I had the same issue and it was driving me crazy. Everything was working fine then after an update on my power automate flow I started to get that same error message.


In my case the issue on my Powerapps trigger.

 

When I checked on my power automate I had the following message:

marcoswnunes_1-1648801948243.png
When I checked my workflow, I noticed there was 3 required content inputs(content_inputs, content_inputs_1 and content_inputs_2). 

 

marcoswnunes_2-1648802041430.png

 

I have no idea why other 2 content inputs were created. I tried to delete but I couldn't. Then I deleted my trigger the re-added it but those extra parameters still there. 

 

My solution was pass those extra parameters in my call on PowerApps so I could move on.

 ExporttoCSV.Run( "My power automate was expecting 3 paramets here" )

 

First: JSON(colDataExported,JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
Second: ""

Third:  ""

 

 

ExporttoCSV.Run(JSON(colDataExported,JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
),"","");

 

There were cases where I has several required paraments. You can peek code to check it:

 

marcoswnunes_3-1648802935322.png

 

marcoswnunes_4-1648803005893.png

 

 

Hope it helps someone in the future. 

 

 

 

 

 

  

Yes, I ran into this myself recently.  There are still aspects of PowerApps that are immature, especially in terms of integration with other members of the PP family.  In my case, I had an integrated flow that itself called SQL stored procedures.  I had to change the SQL side, and therefore needed to change everything upstream including the Run method in the app.  No dice.  PowerApps would NOT let go of the original set of parameters.  Removed connection, renamed flow, refreshed dozens of times, exited the app, etc. etc.  It would not let go of the original parameter signature.  The only thing that worked was completely rebuilding the flow from scratch.  THAT is a massive waste of project development time.  So the issue for me was not setting up the integration - that worked as expected.  It was making a change to the parameters passed via the Ask In PowerApps connector.  They need to take the black box out of this equation and provide us with more control.  To duplicate it just create a Flow integration connection, in the flow add several Ask In Power Apps variables.  Save the flow and the app.  Go back into the flow and remove a few of the Ask In Power Apps variable implementations and save the flow.  Watch in bewilderment as Power Apps hangs on to the original parameter list.  Peek code on the trigger and notice that the original list of parameters is still there.  Only option is to remove the trigger and re-add everything and PRAY you don't make a mistake before saving, or rebuild the whole thing (either option could take similar time depending on the complexity of the flow).  SMH as I ponder the collective number of development hours ($$$) wasted by everyone out there who has dealt with this.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (885)