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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Invalid number of argu...
Power Apps
Unanswered

Invalid number of arguments: received 5, expected 3-4.

(0) ShareShare
ReportReport
Posted on by 1,803 Super User 2024 Season 1
I have this instant Power automate flow, which accept 5 parameters:-
 
 
 
 
 
 
Now when i try to call this flow from my Canvas App, as follow:-
 
 
ExportItems.Run("SPI",
varQueryTrimmedSPI
,User().Email,"1","2");
 
But i got this error:-
 
 
Invalid number of arguments: received 5, expected 3-4.
 
 
As follow:-
 
 
 
so why i am getting this error, although the power automate has 5 parameters and not 3 or 4..
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Invalid number of arguments: received 5, expected 3-4.
    Make sure you Refresh the Flow inside the Power App. This is usually caused by adding additional parameters to the flow and then saving it without refreshing the reference in the Power App.
     
    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • johnjohnPter Profile Picture
    1,803 Super User 2024 Season 1 on at
    Invalid number of arguments: received 5, expected 3-4.
    I did a refresh, remove the flow and re-add ,, nothing help... i am not sure why those technologies keeps failing from time to time!!! what else i can do?
  • johnjohnPter Profile Picture
    1,803 Super User 2024 Season 1 on at
    Invalid number of arguments: received 5, expected 3-4.
     
    I also remove the last parameter, now i am even getting error on the fourth parameter (which use to work well, before i added the fifth paramter), "Expect a record value instead".. i am not sure why it is expecting a record value for the fourth parameter although it is a string parameter???
  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Invalid number of arguments: received 5, expected 3-4.
    What does the string in VarQueryTrimmedSPI Look like? Is it possible that some punctuation in that is being misread when you pass it?
     
    And is the 4th parameter marked as optional?  If its set to be optional then you need to input it in the form of a record.  Something like this
     
    {text4: "string to submit"}
     
    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • johnjohnPter Profile Picture
    1,803 Super User 2024 Season 1 on at
    Invalid number of arguments: received 5, expected 3-4.
     
    I can not set a parameter as Optional... the checkbox if not selectable
  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Invalid number of arguments: received 5, expected 3-4.
     Can you provide a screenshot of what you mean that the checkbox is not selectable?
     
    Also, What does the string in VarQueryTrimmedSPI Look like? Is it possible that some punctuation in that is being misread when you pass it?
     
     
  • johnjohnPter Profile Picture
    1,803 Super User 2024 Season 1 on at
    Invalid number of arguments: received 5, expected 3-4.
    Thanks for the reply, i mean this checkbox is unselectable, as-if it is disabled,, so i mean that i can not make a paramter as optional..
     
     
     
     
     
    any way i were able to fix this issue, by removing the new parameter,  remove the flow from power app, save the power app, re-add the parameter, re-add the flow inside power app, wait fro 1 hour,, and the problem got fixed... I am not sure what caused this problem and what cause it to get fixed... this is another confusion point raised by power platform.. without any leasson learned..
  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Invalid number of arguments: received 5, expected 3-4.
    To be clear, it is a bit confusing. But when you select that checkbox it stays checked but the label next to it changes from "Make the field Optional" to "Make the Field Required". But the checkbox remains checked for both prompts.
  • johnjohnPter Profile Picture
    1,803 Super User 2024 Season 1 on at
    Invalid number of arguments: received 5, expected 3-4.
     
    Things can not be more confusing,, so if the parameter is changed to optional then i will need to pass it as a record instead of as a string?
  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Invalid number of arguments: received 5, expected 3-4.
    ;If it is marked as optional you can still pass a regular value like any other parameter.  But if you want to leave it null then you have to pass it as a record with the parameter name and a null value. You can't not pass a value. Optional just gives you a way to pass a null value.

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard