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 / Adding row to database...
Power Apps
Unanswered

Adding row to database with power apps

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I am a newbie trying to develop some applications in power apps so bare with me it this is just for you guys a stupid question 😅

 

I have a table on a database with let's say 3 columns:

id which is a serial primary key

A which is a varchar column

B which is a numeric column

 

I have seen that I can easily edit one of the columns with a form and a button by using the function collect (please share your knowledge and tell me if there is a better one 😁)

 

Now my problem is trying to add a new row. Whenever I try to add a new row. If I add to the form and to the button to add the id column with collect it tells me the function is not valid. On the other way, if I leave it, it tells me it is missing. 

I am most likely sure it has to do with it being serial but not sure how to write it or configure it to accept new entries. Any help would be welcome!

 

Thank you!

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    First things first.... There are no dumb questions! This forum is here for people to learn from and I learn something every day that makes me think well duh I should have knows that! xD It's par for the course in any type of programming so please by all means dont feel stupid! In 6 months you will be answering questions like me on here 🙂

     

    Collect Function: Adds records to a data source. Can be SP, SQL, Dataverse, Local collection, etc...

    ClearCollect Function: Completely clears the data source THEN adds the records to the now empty collection

    Clear Function: simply clears all rows from the data source passed to it.

    Patch Function: Can be used like collect to add to a collection but can also be used to edit a specific row in a data source. (this is what the submitform functions use. You will sometimes get an error saying patch function failed when using a submitform function and this is why)

    SubmitForm Function: This function simply submits the form for you. the form can be a new form or an edit form and the function will dictate which it should do. (add new or edit based on form mode)

     

    Try something simple first to get used to how it works. Drop in a button and on the OnSelect Property of that button use the following code: 

    Patch(YourSPListName, Defaults(YourSPListName), {Column1: "somevalue", Column2: 15, Column3: "another value"})

    This should add a row to your database within a second or two. Let me know if this helps! I might be slow responding as I am getting ready to be off work but I will respond tonight at some point! 🙂 good luck!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard