1

Preface

I’m working on a project where I need to digitize the form filling process for a testing lab company. The company currently fills out forms manually and makes 40 copies of each form. The form itself is obscenely large (138 pages, 300+ input fields). The forms are then given to a tester who jots down his observations. All of the results are combined back into a result form which is then digitized, printed, and sent to the government. It is imperative that the format is preserved.

The form name is IEC 62368-1 (I have attached an Image as I could not find a web downloadable version). There is a Data sheet and a Test Report by the lab, but all of this process needs to be digitized. I want to create a system where the forms can be filled out digitally, and the data from these forms is used to populate a Word document template. This Word document is then saved and can be printed or sent digitally.

Here’s an example of the data sheet:

62368-1 Test Data Sheet

Image of Test Data Sheet

And here’s an example of the corresponding report sheet:

Test Report Sheet

I want to create a system where a user can fill out a form (either an HTML form or a Microsoft Form), and the data from this form is used to populate a Word document template. The Word document should maintain the same formatting as the original document. The placeholders in the Word document should be added by the program.

Additional Challeges and Preferences

  1. The form needs to be in printable condition which raises the following issues:

  2. Handling images when stitching back the document

    • these fields need to be resized in order to fit the image size on paper Images
  3. Microsoft Stack is Preferred as the company deals in Microsoft Products. ( PowerApps, Azure OpenAI/ Document Intelligence)

  4. The solution I have in mind is that I generate 2 templates each (Test Report and Data Sheet) which is filled by a form (Microsoft Form or a custom Form) and then using Microsoft Automate/Flows this data is sent into an azure function which aggregates all data sheet observations from multiple testers and does some processing and enters into the test report. The Test Report template would resize itself according to the input from the processed Azure Function (Image Fields would expand to the size and images can shrink to fit). Because of the template the layout would be preserved, and Azure functions can take care of the size fields. User will only need to upload Blank Data Sheets and Test Reports, which will be stored on their SharePoint with the processed files that I discussed above. The Manager would be notified when the processed files are available for download.

What I've Tried

  • I’ve tried using docxtemplater to create and populate the Word document, but I’m having trouble adding the placeholders to the Word document. I’m also not sure how to maintain the formatting of the original document.

  • I have also tried Microsoft Forms into Word, but Forms has a character limit which this easily crosses (200 questions per form).

  • I tried the Word Developer tab -> Microsoft Word Forms but then I would need to label 300 questions across 40 forms which is not at all possible

  • The One thing that works almost perfectly is Adobe Forms and automatic labelling. It needs some input from the user, but it does most of it, which is the kind of result I am expecting but as its closed source I cannot resize Image input fields with custom JavaScript (which adobe can run)

Is there a way to do this using JavaScript or any AI service? Any help would be greatly appreciated!

11
  • 1
    These may assist you or help get you started: gmayor.com/ExtractDataFromForms.htm and gregmaxey.com/word_tip_pages/extract_batch_form_data.html. Note these are vba resources, not JS nor AI. Commented Nov 21, 2023 at 20:46
  • 1
    I wasn't in a position to get the form but Re. Labelling 300 questions across 40 forms with content controls you can insert the controls manually while creating the forms templates then label them programmatically.
    – jonsson
    Commented Nov 22, 2023 at 8:55
  • @CharlesKenyon I would need to test the effectiveness of the method and I'll revert with results when I can. Also, I want to clarify that the word file is not so structured, it's using various different word elements (ellipsis to show blanks, tables for structured data, and images) so it's not a proper form, but your method indicates it works for forms.
    – Lucifer
    Commented Nov 24, 2023 at 12:20
  • 1
    Yes, unfortunately I'm just not familiar enough with some of the more modern bits (Automate+, Flows and so on) to make useful suggestions at a "bigger picture" level. Broadly speaking from a long term perspective, if you need to do coding at a "VBA" level you'll probably be better off actually using Office-JS as it's where Microsoft has been heading for several years already.
    – jonsson
    Commented Dec 3, 2023 at 10:57
  • 1
    Yes, that is what I meant.
    – jonsson
    Commented Dec 4, 2023 at 8:49

0

You must log in to answer this question.

Browse other questions tagged .