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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / patch and submit form ...
Power Apps
Answered

patch and submit form in one button

(0) ShareShare
ReportReport
Posted on by 5

Hello, 

 

I'm new at powerApps and i'm having a couple of issues with my app. If anyone could help I would really appreciate it.

First thing is, how would I go by submitting a form and a patch by clicking only one button. 

 

so far I've done this :

 

SubmitForm(Form5);
Patch(
VisitorEntryList,
Defaults(VisitorEntryList),
{
ReasonForVisit: TextReasonForVisit.Text,
Question1: Rquestion1.SelectedText,
Question2: Rquestion2.SelectedText,
Question3: Rquestion3.SelectedText,
Question4: Rquestion4.SelectedText,
Question5: Rquestion5.SelectedText
}
);
Navigate(
ScSuccess,
ScreenTransition.Fade
);
ResetForm(Form5);
Reset(TextReasonForVisit);
Reset(Rquestion1);
Reset(Rquestion2);
Reset(Rquestion3);
Reset(Rquestion4);
Reset(Rquestion5);

 

But it creates 2 entries on my SharePoint list. I want all of them in one.

 

Second is , i want to have a page for people checking out of the building. What i want is, i want a gallery that will take my sharePoint list search the TimeOut column and only display the names that the time out is empty.  Create a button next to it and when click on it , it will check them out and return and write on that column the time.

 

and third and last how can i create a drop down box that connects to that same SP list take the 4 choices that i have in a column and display those choices in the app? 

 

So that's all 😋😋 

 

If anyone can help me i would really appreciate it. 

 

Again thank you very much 😊

Have a beautiful weekend everybody.  

Categories:
  • CU24091509-0 Profile Picture
    417 on at

    Please follow this.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Submit-amp-Patch/m-p/418571#M123823

     

     

    Thanks,

    Kranthi

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • eka24 Profile Picture
    20,925 on at

    Are Rquestion1 Rquestion dropdowns

    Or

    Radio buttons?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Dimitra_s 

    SubmitForm() does the same thing as a patch.  Are the fields different in the form and in your patch?  If your Form has the same five questions as your patch, then the patch is redundant and will create a duplicate record. 

    Secondly,  you should never have anything other than the SubmitForm()  in your Save button.  Any other commands should be moved to the OnSuccess property of the form so they aren't executed unless the Form submits successfully.

    The Items property syntax of a dropdown that will show unique values should be 

    Sort(Distinct(DataSource, FieldName),Result,Ascending)

     

  • Dimitra_s Profile Picture
    5 on at

    Hello First i want to thank you all for replying to me.

    I apologize in advance, I don't want to sound like stupid but be patient with me. This is my first try with powerApps and I have been studying a lot though.

     

     

    @KranthiTupakula 

    I tried this and it doesn't work for me Capture.JPG

    @eka24 

    No Rquestions are just radio buttons and I just patch the results to my SP list

     

    @Drrickryp 

     

    Hello 🙂 

     

    Again I don't want to sound like stupid but on my button i can't find a onsuccess property it only has the Onselect.

    Yes they are from the same list. But on the form i have deleted the things i put in the patch so basically half of them are in a form and the other ones i put in the patch so it shouldn't create a duplicate record. 

     

    How can i change that formula and basically say only show me the names of the people that the Time OUT is null?

    Sort(Distinct(DataSource, FieldName),Result,Ascending)

     

    Again thank you so much for your help. You are a lifesaver.

     

     

  • eka24 Profile Picture
    20,925 on at

    Change the all Question1: Rquestion1.SelectedText

    To

    Question1: Rquestion1.Selected.Value

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Dimitra_s 

    OnSuccess is a property of the form itself not the button

  • CU24091509-0 Profile Picture
    417 on at

    Try to write the patch code on form success.

    KranthiTupakula_0-1596232466577.png

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    HI @Dimitra_s ,

    For your first question, I think there is something wrong with your formula you provided. The SubmitForm function and the Patch function both add new records into your SP List.

     

    Regarding the needs that you mentioned, I think the Patch function is enough to achieve your needs. Please consider modify your formula as below:

    Patch(
     VisitorEntryList,
     If(
     Form5.Mode = FormMode.New,
     Defaults(VisitorEntryList),
     BrowseGallery1.Selected // The BrowseGallery1 represents the Gallery in your app, which list all available records from your SP List
     ),
     Form5.Updates,
     {
     ReasonForVisit: TextReasonForVisit.Text,
     Question1: Rquestion1.SelectedText,
     Question2: Rquestion2.SelectedText,
     Question3: Rquestion3.SelectedText,
     Question4: Rquestion4.SelectedText,
     Question5: Rquestion5.SelectedText
     }
    );
    Navigate(
     ScSuccess,
     ScreenTransition.Fade
    );
    ResetForm(Form5);
    Reset(TextReasonForVisit);
    Reset(Rquestion1);
    Reset(Rquestion2);
    Reset(Rquestion3);
    Reset(Rquestion4);
    Reset(Rquestion5);

     

    For your second question, you could consider add a Gallery in your app, set the Items property to following:

    Filter(
     VisitorEntryList,
     IsBlank(TimeOut)
    )

    then add a button (called "Checked Out") inside this Gallery, set the OnSelect property of the button to following:

    Patch(
     VisitorEntryList,
     ThisItem,
     {
     TimeOut: Now()
     }
    )

     

     

    For your third question, do you want to connect a Dropdown box to a Choice type column or a Text type column in your SP List?

    Please consider add a ComboBox in your app, set the Items property to following:

    a) If you want to connect a Dropdown box to a Choice type column

    Choices(VisitorEntryList.ChoiceColumn)

    b) If you want to connect a Dropdown box to a Text type column:

    Distinct(
     VisitorEntryList,
     TextFieldColumn
    )

    Note: Set the SelectMultiple property of the ComboBox to false.

     

    Regards,

  • jufguu Profile Picture
    133 on at

    Wow it worked for me Thank you so much

  • minyasmeen08 Profile Picture
    2 on at

    same like the other picturesame like the other pictureplease help me with this error, how to solve the network error i don't understandplease help me with this error, how to solve the network error i don't understand

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard