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 / Data is not getting st...
Power Apps
Answered

Data is not getting stored in my sharepoint list using patch function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

My power app has a radio button 1 for copy record  and 2  for creating record

for the first 1 button ,the user will be able to copy the record and submit

and for the 2 user has to manually enter the details to submit the form

 

I'm using label's for autopopulating the record from the sharepoint list for the first radio button 

Label text property : LookUp(SUAD,'Employee Name'=ComboBox1.Selected.Result,Module)

 

when submitting the form I'm setting these labels as variable

on select of submit buttonSet(var01,Label17.Text);Set(var02,Label15.Text);submitform(form1)

 

on success of my form   : If(Radio1.Selected.Value="Role copy",Patch(SUAD,First(Filter(SUAD,ID=Form1.LastSubmit.ID)),{M1:var01},{R1:var02}));Notify("Your Submission has received",NotificationType.Success);ResetForm(Form1);NewForm(Form1)

 

The data is not getting recorded into my sharepoint list and the form isn't resetting after submission, it is shown as nothing to display 

 

Could anyone help to figure out the exact issue

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    I think this code causes the problem.

    vjefferni_0-1670579832641.png

     

    You could try the following code:

    If(Radio1.Selected.Value="Role copy",Patch(SUAD,Defaults(SUAD),{M1:var01},{R1:var02}));Notify("Your Submission has received",NotificationType.Success);ResetForm(Form1))

     

    Note: 1. NewForm will convert the form to New mode, which will include nothing in the form. 2. Patch to a specific record which defines in the second parameter will not generate another record, but just update the existing one.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    HI,

     

    The form is getting reset after submission  but, the data is not getting stored in my share point list

  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @Anonymous ,

    Firstly, please get away from those calculated labels - they are not reliable in their refreshing sequence and set Variables directly on the relevant formulas (put the other formula in where I have it marked). Also capture everything before you submit the Form

    UpdateContext(
     {
     varCopy: Radio1.Selected.Value,
     var01:
     LookUp(
     SUAD,
     'Employee Name' = ComboBox1.Selected.Result
     ).Module,
     var02:
     YourLabel2FormulaHere
     }
    );
    SubmitForm(Form1)

    then OnSuccess (you do not need to reset the Form if you are going the change mode to New)

    If(
     varCopy,
     Patch(
     SUAD,
     {ID: Self.LastSubmit.ID},
     {
     M1:var01,
     R1:var02
     }
     )
    );
    Notify(
     "Your Submission has received",
     NotificationType.Success
    );
    NewForm(Form1)

     

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard