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 / I have to click the Su...
Power Apps
Unanswered

I have to click the Submit button twice to submit form

(0) ShareShare
ReportReport
Posted on by

I have a canvas app connected to a SharePoint list. I added a multi-select checkbox data card (DataCard1) to the form, deleted the default control, and inserted a gallery (Gallery1) on DataCard1. I'm storing the user's checkbox values in a collection. My "Submit" button simply submits the form: SubmitForm(NewForm1);

 

If the Required property on Gallery1's data card is set to false, the form submits as expected. No issues. However, if I set the Required property on Gallery1's data card to true, and then click "Submit," the form fails (the form's OnFailure notification displays). However, if I click the "Submit" button again, the form submits just fine. I cannot figure out why I have to click the "Submit" button twice.

 

DataCard1 > Default and Update properties

colCollectionName

 Gallery1 > Items property

Choices([@SPListName].MultiSelectColumnName)

 Gallery1 > Checkbox1 > Default property

ThisItem.Value in colCollectionName.Value

Gallery1 > Checkbox1 > OnCheck property

Collect(colCollectionName, ThisItem) 

Gallery1 > Checkbox1 > OnUnCheck property // Updated

Remove(colCollectionName, ThisItem) 

Gallery1 > Checkbox1 > Text property

ThisItem.Value

The button that opens NewForm1 > OnSelect property

ResetForm(NewForm1); NewForm(NewForm1); Clear(colCollectionname); Navigate(ScreenSignUp,ScreenTransition.Fade)

Steps I've tried:

  • Ensured every field in my SharePoint data source is not required (I've checked every field three times)
  • Removed and re-linked the SharePoint data source
  • Deleted and re-added the data card with the multi-select checkboxes
  • Deleted and re-created the gallery on the data card
  • Exported and re-imported the Power App
DataCard-Gallery-CheckBoxes.jpg
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @Siddz ,

    Firstly, your OnUncheck should be

    Remove(colCollectionName, ThisItem) 

     if this is not the issue, put a label on the screen with 

    CountRows(colCollectionName)

    and see if it is greater than zero before you submit.

     

    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.

    Visit my blog Practical Power Apps

  • Siddz Profile Picture
    on at

    Hi, @WarrenBelz.

     

    Thanks. I fixed the OnUnCheck property in my original post (copy/paste mistake). In my app, OnUnCheck was set to:

    Remove(colCollectionName, ThisItem)

    I added a label to count the rows of my collection and the number increases when I click each checkbox, and when I de-select a checkbox, the number decreases, as expected:

    CountRows(colCollectionName)

    Also, when I make selections and view my collection (View > Collections), the checkbox values are being populated in the collection. I just have to click the submit button twice before the form will submit. The first time I click submit, the form's OnFailure property is triggered, but if I click submit again, the form submits fine and updates the values in the SharePoint list. 

  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @Siddz ,

    The item that affects this is the Update of the Data Card. You currently have this (correctly) at colCollectionName. I assume here you are patching back to a multi-choice field (MultiChoiceColumnName), not a Lookup field.

    Try in the Update (although you should not have to do this)

    ForAll(
     ColCollectionName As aList,
     {Value: aList.Value}
    )

     

    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.

    Visit my blog Practical Power Apps

     

  • Siddz Profile Picture
    on at

    Thanks, @WarrenBelz.

     

    I added this to both the Default and Update properties on the data card that holds the gallery with the checkboxes:

    ForAll(
     ColCollectionName As aList,
     {Value: aList.Value}
    )

    I had to add the ForAll() function to both properties, but so far so good. The form now submits with one click and  the backend SharePoint list is getting updated. 

     

    Thanks for the workaround!

  • David_RO Profile Picture
    17 on at

    Thank you it solved my problem... I lost so many hours on this.... Thanks MS too...

  • SphesihleSibiya Profile Picture
    81 on at

    Thank you for the solution. Worked Perfectly for uploading camera images taken inside powerapps as attachment in a sharepoint list.

  • theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Hello @WarrenBelz :

    Thanks a lot..this solution has helped me save a lot of my time.

  • trhineberger Profile Picture
    3 on at

    Thank you!!  Solved my issue too 😉 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard