How do you get form on a new page to create a record and autosave

How can I make it so that when someone loads a particular page it displays a form and automatically creates a blank record in the database relating to that form and then it autosaves whatever the user types in every 30 seconds or so?

Sure, when page loads, create a ā€œthingā€ (form) and display it in a group.

Make the input refer to the parent group, and put on auto-binding. Auto binding saves it instantly after itā€™s been typed.

1 Like

Yes! It worked.

I figured it was to do with autobinding, but had missed the ā€˜Page is loadedā€™ step and the displaying data.

Thanks @stone

One more thing @stone. How do I stop it creating a new entry if the user doesnā€™t enter anything?

For example, they load the page and then either close it or hit the back button without making an entry.

You can set up a workflow to automatically delete any item that has all fields empty. You can automate this with API workflows, too.

Personally I wouldnā€™t set it up like this, though. I would just have a ā€œsubmitā€ button that creates a ā€œthingā€ when clicked. So It does not create a ā€œthingā€ on page load. And only let it create it if fields are not empty, there is a checkbox on each input for this.

I know what you mean about the submit button, but the problem is that it is a journal entry system and people will just expect a new entry to appear each time the page loads as thatā€™s how most of them work. In fact , most that Iā€™ve seen donā€™t even have a proper save button as they just autosave every few seconds.

Iā€™m not familiar with API workflows. Would I be able to get those to run on page exits, or if someone clicks on one of the previous journal entries in the list on the left hand side of my page?

Ah, I see.

Make an API endpoint (which is a server workflow) set that to first do the cleanup, then schedule itself one day later. Fully auto.

Like picture below:

1 Like

Do I do that on the Settings>API tab @stone?

I donā€™t have a clue what I am doing with APIs so if thereā€™s any more step screenshots you could show me that would be AWESOME!

Iā€™ve managed to get the rest all working great, including the journal list on the left hand side not listing the empty entries, so all looks great - just need to get this API sorted.

Make sure to enable API workflows in the settings first, then you can find the API page.

image

1 Like

@stone You are the master :slightly_smiling_face:

Your instructions worked a treat and I now have that all set up. Buzzing!

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.