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 / Error Patch: when clic...
Power Apps
Answered

Error Patch: when click button in PowerApss From create item in sharepoint list

(0) ShareShare
ReportReport
Posted on by 888 Season of Giving Solutions 2025
Hi guys,
 
So I am creating a form and when it's submitted it creates an item in a SharePoint list. It looks like this
The function is: 
 
Patch(BústiaGestióDocumental, Defaults(BústiaGestióDocumental), {Títol: "Títol", Tipus_x0020_Incidencia: {Value: "Tipus Incidencia"}, Apartat: {Value: "Apartat"}, Comentaris: "Comentaris"})
 
The name of the list is BústiaGestióDocumental.
The columns are:
  • Títol (Single line text)
  • Tipus Incidencia (Option)
  • Apartat (Option)
  • Comentaris (Multiple line text)
When I write them there are multiple errors, What could it be?
 
I think it's getting the list name correctly and the else (columns) wrong.
 
Any help will be useful. I don't really know what to do I am new to this.
 
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,160 Super User 2026 Season 1 on at
     
    Try this,
      
    Patch(BústiaGestióDocumental, 
    Defaults(BústiaGestióDocumental), 
    {
    Títol: controlname.text,
    Tipus_x0020_Incidencia:Dropdown_Status.Selected,
    Apartat: Dropdown_Status.Selected,
    Comentaris: controlname.text
     
    })
     
    You are hardcoding the values for Títol and Comentaris column which should be controlname.text.
     
    I am having the data like this for the dropdown and it item property 
     
    Sort(Filter(RequestForm, Language=varbrowserLang,Key), Key)
     
     
     
    Patching the choice column
    Tipus_x0020_Incidencia:{Value:(controlname.Selected.Key)}
     
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • Charlie Martharper Profile Picture
    888 Season of Giving Solutions 2025 on at
     
    I am using a SharePoint On-Premise so I don't know it should be any problem with it, but it seems not because I have connected it propperly. 
     
    I wrote the code but it seems I have the same trouble. I am having a hard time trying to understand it also 😥. This is what I add as the function:
    Could you, please, explain it a little bit more precise? Like a step by step because i dont know what you mean or where to put: 
     
    • Sort(Filter(RequestForm, Language=varbrowserLang,Key), Key)
    • Patching the choice column
      Tipus_x0020_Incidencia:{Value:(controlname.Selected.Key)}
    Thanks for your answer, if it has worked for you I am sure it will work for me.
     
  • MS.Ragavendar Profile Picture
    7,160 Super User 2026 Season 1 on at
     
    Are you using SharePoint On-Premise as a data source to the PowerApps can you please confirm
  • Charlie Martharper Profile Picture
    888 Season of Giving Solutions 2025 on at
    Yes @MS.Ragavendar, it's a SharePoint On-premise the SharePoint list that is on the form. 
  • MS.Ragavendar Profile Picture
    7,160 Super User 2026 Season 1 on at
     
    In-order to save a record in to the database there are multiple ways.
    • If the controls are built using any form controls (Classic / Modern) 
      • SubmitForm(FormName) this will allows to save the data in the backend.
    • If the controls are not stacked in the form its designed as stand alone controls then to save record Patch will be used , it can be used to save and update as well.
      • Patch ( Save)
    Patch(BústiaGestióDocumental //DataSource, 
    Defaults(BústiaGestióDocumental) // This has to provided if its newly creating record, 
    {
    Títol: controlname.text, //controlname.text it represent you enter data in text box that data needs to mapped to the Títol column in the backend means then you have provide the controlname.text
     
    Tipus_x0020_Incidencia:{Value:(controlname.Selected.Key)},
     
    Apartat: Dropdown_Status.Selected,
     
     
    })
  • Charlie Martharper Profile Picture
    888 Season of Giving Solutions 2025 on at
     
    I tried the first option "SubmitForm(BústiaGestióDocumental)" but it doesn't work. It says the function expects an editable form as an input when "BústiaGestióDocumental" it's a form actually (you can see on the left).
    When trying the second option it hits me with 5 errors in the formula. 
     
    In my opinion I think it doesn't get the form correctly.
     
    But let me know what do you think I don't know why it doesn't work. I thought it would be a lot easier. 
  • MS.Ragavendar Profile Picture
    7,160 Super User 2026 Season 1 on at
     
    You placing the button outside the form. Add the button inside the form and try with the submitform(formname)
  • Verified answer
    MS.Ragavendar Profile Picture
    7,160 Super User 2026 Season 1 on at
     
    Select the Form - > Edit Fields - > Add Field -> Add Custom Card
     
     
    Once the card is added, now add the button inside the card and try with the SubmitForm(Form1) this will save the record.
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • Charlie Martharper Profile Picture
    888 Season of Giving Solutions 2025 on at
     
    Ok now it's correct but now I have the next error: The function is recognized but not addmited
    I added reset form but it doesn't get the form right also.
     
    submitform(BústiaGestióDocumental); resetform(BústiaGestióDocumental)
     
    Could it be a permission issue?
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,160 Super User 2026 Season 1 on at
     
    Its syntax issue.
     
    SubmitForm(YourFormName);
    ResetForm( FormName );
     
     
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 860

#2
Valantis Profile Picture

Valantis 548

#3
Haque Profile Picture

Haque 417

Last 30 days Overall leaderboard