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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with Invalid argu...
Power Apps
Answered

Help with Invalid argument, I can't find the error

(1) ShareShare
ReportReport
Posted on by 84

Hi friends,

 

I've started this form from a Sharepoint list where I want the answers sent to. I then replaced the DataCardValue1 and DataCardValue3 with the controls I needed (combobox for the first, checkboxes for the last). I am wondering if that is the problem, here is a screenshot of my Tree View (the new controls are wrapped in their DataCards)

form.jpg

On the Submit button I have tried the following OnSelect formula:

SubmitForm('Form1');
I got no errors but when testing it, I only received the answer for question 2 (Reason).
 
So I got this formula and have one error that I can't get rid of:
SubmitForm(
    'Form1',
    {
        Title: ComboBox1.Selected.Title,
        Reason: DataCardValue2.Text,
        'Core Value':
            If(Checkbox4.Value, "We passionately believe in what we are doing, ", "") &
            If(Checkbox3.Value, "We continue to innovate, grow and develop, ", "") &
            If(Checkbox5.Value, "We are upfront in what we say and do, ", "") &
            If(Checkbox2.Value, "We take pride in delighting the customer, ", "") &
            If(Checkbox1.Value, "We value each other’s strengths and effort for the team, ", "")
    }
)
The error is: Invalid number of arguments: received 2, expected 1."
Some screenshots for reference:

formula.png

error.png

Hopefully someone can spot where the error is, I am new at this and have been trying to make this form for days and days so getting really desperate haha (crying)

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @juls ,

    You are submitting a Form - what are you trying to do with the rest of the code - it appears to be a Patch without the Patch function.

  • Verified answer
    365-Assist Profile Picture
    2,324 Moderator on at

    I believe you are confusing actions between SubmitForm and Patch.

    e.g. Patch(SharePointList

     {
            Title: ComboBox1.Selected.Title,
            Reason: DataCardValue2.Text,
            'Core Value':
                If(Checkbox4.Value, "We passionately believe in what we are doing, ", "") &
                If(Checkbox3.Value, "We continue to innovate, grow and develop, ", "") &
                If(Checkbox5.Value, "We are upfront in what we say and do, ", "") &
                If(Checkbox2.Value, "We take pride in delighting the customer, ", "") &
                If(Checkbox1.Value, "We value each other’s strengths and effort for the team, ", "")
        })

     

     

    ---------------------------------------------------
    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    Subscribe: https://www.youtube.com/channel/UCFpvUlpx84FuIPOdInGKMTw

    Regards
    Darren Lutchner - 365 Assist

  • juls Profile Picture
    84 on at

    Hi Warren, as I pointed out I tried SubmitForm('Form1'); however all my answers were not submitted, just one. So chatGTP gave me that formula, that I realise is similar to the patch function (I used that before trying to do this a different way, but I scratched and started again from 0)

  • juls Profile Picture
    84 on at

    I am most likely confusing everything sorry, but I really just want to submit the form and send the answers to a sharepoint list. Should I try the Patch function again?

  • juls Profile Picture
    84 on at

    That worked, thank you so much! I was ready to give up! haha 

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    @juls ,

    EDIT - I see you have gone down the Patch path, but you do not have to as below.

     

    I won't get into ChatGPT discussions (that is why you have humans on the forum) but this is just another example of highly confusing responses. I believe that you are better submitting the Form and setting the Default of your 'Core Value' Text Box to the formula you have.

    If(
     Checkbox4.Value, 
     "We passionately believe in what we are doing, "
    ) &
    If(
     Checkbox3.Value, 
     "We continue to innovate, grow and develop, "
    ) &
    If(
     Checkbox5.Value, 
     "We are upfront in what we say and do, "
    ) &
    If(
     Checkbox2.Value, 
     "We take pride in delighting the customer, "
    ) &
    If(
     Checkbox1.Value, 
     "We value each other’s strengths and effort for the team, "
    )

    I also assume the other two fields are on the form.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard