Same dynamic page to edit data or add new

Hello all,

I have a repeater with a button for a user to edit that data. When the button is clicked, it opens the dynamic page for that record. This is working perfectly. In addition, I have added a button above the repeater that allows the user to Add a new record to the dataset. This button goes to a different page with blank user input fields. When the user clicks submit on this page, a new record is added.

I would like to only maintain one data entry page with the ability to both Add a new record or Edit an existing record. My thought would be to add a blank record with just an ID in the dataset and have the Add New button point to the dynamic page and open that record. The user could then enter data and click Submit.

My issue is that I need to determine if the record that was opened is the blank record (ID = 12345), and if it is the blank record, I would need the user input to be saved as a new record with a new ID generated.

Any thoughts on this would be great.

Thanks

You could possibly use the Members Profile tutorial as a starting point to work off from for this dynamic page.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

Thanks for the quick reply. This is a great start. So, using the Members Profile as an example, I now need to have the ability to add a New Member by changing a few fields of an existing member.

For example, a user wants to add a new member that has a lot of the same info as an existing member. They click to Edit John Smith, change John to Sara to add his sister as a new member but keep John Smith in the collection as well.

Is is this possible?

Any thoughts on the above? I would love some input or ideas.

Thanks