Unable to create a Members only page that can save NEW data into database as well as allows modifications to it in the same form/page

Hi,

I know this has worked before for me but somehow in my new project, I’m failing to complete a simple task.

Task: I have created 5 fields on one page (3 text fields and 2 drop downs) and connected it to a new dataset. The page is part of Member pages. All I’m doing is to accept values from user and save them to the db. Also, thereafter, allow the user to see their input data for modifications. To confirm, I’ve connected all those individual fields to the right dataset and fields.

Problem :
When dataset permission (from within the same page) is set to READ/WRITE, In sandbox I’m able to edit the fields. But in Live environment, those fields are greyed out (similar to being in read only mode). And I’m unable to enter any data or use submit button.

However, when dataset permission (from within the same page) is set to WRITE, In both sandbox as well as in Live environment, I’m able to edit the fields. However, WRITE mode will not display already submitted content. And my page design does not have enough space to create a copy of those fields separately for display. My requirement is to have a single page that can both accept first time data as well as view already submitted data.

Inside the dataset collection settings, I’ve selected custom permissions. See attached screenshot for details.

I’m sure I’ve done this before in other pages successfully. But I just can’t seem to find what is missing here.

What is the best way to allow members to submit data and also see it thereafter for modifications in the future?

In case someone else comes here, I found the below solution:

You would require to put the page to READ/WRITE. However, it requires the database to have atleast one record to make it an editable field. So you would be required to write a short piece of code triggered by onready() function… wherein you could create a dummy field in the same database and populate it with a dummy value as soon the page loads.

You will see that the fields become editable as soon as the page loads (in reality it takes about a second or so). However, to avoid creation of multiple overwrites everytime user loads the page… put a simple if condition before your code where it is applied only if the count of records is equal to 0.

Hi Rishal! I need exactly this, can you share your code please? @rishalsharma