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!
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!
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473