Is there any way to get a print or a PDF from ODK Collect after submitting the form or before submitting it?
Is it possible to give Enketo link to the submitted form so we can get a print or PDF?
Any other method, please suggest.
We plan to add a way to print HTML snippets from Collect in the following release, expected in December or January. This will mostly be intended for things like printing out QR codes to link follow-up records and/or printing out a subset of collected information on a label. It could possibly work to print out all data collected in a submission if that submission is relatively small.
Could that meet your need? If not, can you please describe it in more detail?
Hi LN, Your guidance is always helpful. We are developing an assessment of government health facilities on ODK. We expect health facilities to keep this information in PDF for reference and see their gaps to fill. We need a well-designed, Enketo-type PDF for their records. It is better if 'Enketo' like pdf facility is also available in 'Collect'
It'd be helpful to know why you prefer not to use Enketo for data entry.
We have an assessment form with multiple fields. It takes time to fill, sometimes more than one day. Users are more comfortable with ODK Collect because it has the facility to save drafts, view sent forms, save during entry, and the big assessment form loading / response are fast.
That makes sense, thanks. We don't have a great solution for you yet but will consider what we can do.
Greetings @LN ,
As you mention above, could this be something that has since been worked upon?
Its increasing becoming much needed to print a portion of either the results or filled in information as pdf. Am currently supporting a semi-annual routine where the collected data in ODK collect is used to compute results, make comparisons with existing routine data in a national system and provides elaborate monthly and quarterly summaries for the entity and for a higher admin unit - often district. The exercise often takes like 3 days to complete - so both the entities and the higher admin levels need the summary report (achieved in collect) to be printed and even stamped at both levels. So the print feature is critical in this case; see xls
Would https://docs.getodk.org/form-question-types/#printer-widget meet your needs? This is particularly appropriate if you need to print a relatively small number of form fields. It may be tedious to create an HTML template for a large number of fields (but it's possible!). As an alternative to writing HTML by hand, you could use a tool like https://wordtohtml.net/html-editor-online to generate it. I recommend putting your form fields in ${} directly in the editor. You'll then need to convert it to use concat
to insert your form values (see docs).
The conversion is something that could be automated if someone is looking for a fun script to write. I also quickly tried using ChatGPT 4o for the conversion and it worked well with the following prompt:
There's a concat function that takes multiple arguments. I'd like to give you some HTML and I'd like you to split it up into arguments to the concat function. Every time you see a value in ${}, that should be a separate argument. I'd also like you to strip out style attributes, please.
Dear @LN , thanks very much. That print widget provided the perfect solution. The print was far beyond expectation, and was able to nicely print multiple pages of the required summaries - https://wordtohtml.net/html-editor-online adds very excellent styling. After this I only used the excel 'find and replace' function instead and it quickly formatted everything well for the concat() calculation.
Much appreciate.
Love to hear this, @JosephKi! Good point about search and replace working well for preparing for the concat
function! Did you do something like replacing ${
with ", ${
and }
with }, "
If you're able to share your form and/or HTML template, I think we'd all learn from it.
Yes @LN ,
And after replacing ${ with ", ${ and } with }, "
Somehow, I tried to look for a possible unwanted "", somewhere. And I found 1 such kind in each round of printing - raw level (health facility level) and at aggregate level (local government level). Which was replaced with ", each time. see the form;
SAVTool.xlsx (149.6 KB)