Take default values from another form using form id

I have more than 40 form stages and I want my users to not have to refill all the fields again except if they are filling the form for the first time. Is it possible to do that using the form id of their last submission?
ps. I have the form id of each submission of a user stored in the database so getting that isn’t a problem

Hi @alizwarraich, you can use an api connector and advanced logic, then query the data from the previous submission via our public API: Feathery API Reference

@kailash there are a few stages in my form which can be skipped based on some condition for example if the user is on stage 1 and they select option 2 and option 3 in a checkbox field, they will see both stage 2 and stage 3, but if they select only option 3, they will be navigated from step 1 to step 3 so step 2 will be skipped.

So as the submitted fields are dynamic based on the user’s input, the list all data for a user endpoint doesn’t return the fields of the stage which was skipped. Now the problem is that I have mapped the fields of JSON response when setting the API connector, but it’s not working correctly because the size of response array can be different based on the user’s input and so the index position for each field can be different.

Is there a way to map these fields based on the “id” of the object rather than its position in the response array so that the array size won’t affect the field mapping?

Reference:

The API connector mapping requires static paths (either by key or numerical index) and can’t do dynamic logic such as searching for a specific key across a variable number of entries in an array. This can be solved by refactoring your API response if desired

thanks for the response @peter. My primary goal was to take the values out of previous submission (if exists) and use it as initial values for the new form submissions. The initialValues prop in Form component is working great except for the image/file upload fields. Can you tell what format I need to upload in order for it to work correctly? Is it File or Promise<File> or Promise<File>[]?

an array of files i believe. no need for promises when setting the value

1 Like