precision-sustainable-ag / Craft-Management

0 stars 0 forks source link

Duplicate form #41

Open saseehav opened 3 hours ago

saseehav commented 3 hours ago

To create the link to duplicate the form When the Webhook is triggered, send email confirmation. job in source code to pass the data submission to the job. attach the form object to tell which properties are fillable. go through the submission, pull out data in key names. build a new URL with all the defaults added to the survey and opens a new Enketo link with pre-filled data.

needed in each form:

Issue: Repeat sections Cannot pass back data from repeat sections AFTER the FIRST repeat Possible Work around:

To make this work: pass a block of text into a NOTE prior to each REPEAT section. The block of text would appear after the duplicated form was passed back through the duplicate form button in the email. The duplicated repeat text block insert language: "If you already filled this section in a previous form and have NO edits continue to the next section. If you DO have entries to change in this section for this plot, please re-fill the whole section with all relevant entries."

Tried: passing a json object of the repeat section already filled form last form into a text block so they can see what they filled. Fail: json object needed to be passed through in the URL, and there is a 2,000 character limit. So, growers would have to visit their old submission to see the items they filled.

saseehav commented 3 hours ago

Parent ID needed to inject previous data into all the submissions so that Tina can view all skipped data for each form. Once Kobo triggers webhook, kobo could trigger parent id submission and take data not entered into the json for them.

Work around - add a radio button that says "I want to use previously filled data". Q: can this button appear conditionally when duplicate button is pushed? what do i need to make this appear conditionally?

Dashboard for form viewer....... if parent id doesn't work. which it likely won't to update a submission after it's created.....

Plan A: can replicate the functionality on the Kobo page to edit the submission to insert the previously inserted information Plan B: dashboard for Tina to view stitched together forms Plan C: Growers use kobo to hit the Duplicate button.