How to load a form using FormItLoadSavedForm

Hello im using the following snippet and im trying to load a previously submitted form using its unique has from the db. Does anyone succeded with this before? I need help. Thanks in advance.

[[!FormIt? 
&preHooks=`FormItLoadSavedForm` 
&updateSavedForm=`true` 
&savedFormHashKeyField=`593a2d9ea518476ecc4d1ccc3e849c52` 
&hooks=`FormItSaveForm` 
&formFields=`name,identity` // parameter of FormItSaveForm

]]

1 Like

According to the documentation, &savedFormHashKeyField should be the name of a GET parameter that contains the hash - not the hash itself.

So you could generate links like /my-form?key=593a2d9ea518476ecc4d1ccc3e849c52, and do:

[[!FormIt? 
  &preHooks=`FormItLoadSavedForm` 
  &updateSavedForm=`true` 
  &savedFormHashKeyField=`key` 
  &hooks=`FormItSaveForm` 
  &formFields=`name,identity` // parameter of FormItSaveForm
]]
1 Like

It doesnt work either. Did you manage to make it work @markh ?

1 Like

Sorry, I’ve not had the need to use that before.

1 Like

Anyone that made this to work properly?

1 Like

Hi @markh, how to generate that url from the hash, I guess that would be a prehook?

Is it literally just take the hash, make it into a url (does that need to work?) and then use GET to strip out the rest and leave the hash?

Any update here? I do think its not hard to convert the hash into a GET value

Same problem, help pls :frowning: