Auto-populate fields with OCR
Workflow purpose
This guide demonstrates how to use Proto's platform to auto-populate structured fields from a photo or scanned document a user uploads – an ID card, receipt, or claim form – instead of asking them to type it all out. Proto's Send API action passes the uploaded file's link to your OCR or document-reading service: the user attaches a document, the service reads it, and the fields come back ready to confirm.
Who can benefit from this guide:
- Any workflow that currently asks a user to retype details from a document they already have
- Claims, KYC, and account-opening flows that rely on ID or form uploads
- Operations teams wanting to cut data entry errors from manual re-keying
- Teams building any intake flow where "just upload a photo" is faster than a form
Auto-populate fields from an uploaded document
This workflow sends an uploaded photo or scan to an OCR service with a Send API action and presents the extracted fields for the user to confirm. See how to auto-populate fields with OCR.
1. Create a trigger
Purpose: Start the flow wherever a document upload would save the user time.
- Navigate to the Workflows tab in the AI agent settings.
- Click New workflow and select Message received as the Workflow type, or insert this as a step inside an existing intake flow.
- Name the trigger “Document field extraction”.
2. Ask survey – attachment upload
Purpose: Collect the document itself before attempting to read it.
- Add an Ask survey action titled
Document upload. - Field
document_image– Attachment (single file) – Please upload a clear photo or scan of the document. – Enable skip off.
3. Send API – field extraction
Purpose: Read the document and return only the fields you actually need.
- Add a Send API action named
Document field extraction, using the POST method, to your OCR or document-reading service. - Body: the uploaded file’s link and the fields you want, e.g.
{"file_url": "{document_image["download_url"]}", "fields": ["full_name", "document_number", "date_of_birth"]}. - Resulting variable:
extracted_fields. - Configure the service to return
nullfor anything it can’t read clearly rather than guessing. - LLM Processing only takes text as input, so it can’t read the image itself. Under Error and Timed out, fall back to the manual Ask survey from step 5.
4. Set variables – map the extracted fields
Purpose: Move the extracted values into the same variables the rest of the flow expects.
- Add Set variable actions for each expected field, e.g.
full_name = extracted_fields["full_name"].
5. Confirm or correct
Purpose: Let the user catch anything the service misread before it’s submitted anywhere.
- Add a Send message action summarising the extracted fields, followed by quick replies Looks right and Something’s wrong.
- Add a Set variable action to capture the reply as
confirmation_choice– quick reply selections aren’t captured automatically, so this step reads_user_inputinto the variable. - Add a Branch action. Condition:
_.lower(confirmation_choice) == "something's wrong"→ route to a manual Ask survey for the affected fields. Otherwise, continue with the extracted values as they are.
6. Test the flow
Purpose: Confirm the extraction is reliable enough to trust before it feeds downstream actions.
- Test with a clear, well-lit photo and confirm every field extracts correctly.
- Test with a blurry or partially cropped photo and confirm the service returns
nullfor unreadable fields instead of inventing a value. - Test the correction path to confirm a user can fix a misread field without restarting the whole flow.
.png)