Parsing the attached document using GEN AI and showing parsed structured response in same screen

Current setup:

  • On the review screen, the customer uploads a new address proof using the OOTB attachment field.

  • I created a property called AttachAddressData of type Attachment.

  • I referenced this property in the view, so Pega renders the attachment control.

  • After the user submits the screen, I am able to call a GenAI Connect rule on the server side, parse the uploaded document, and prefill the new address fields successfully.

Problem:

  • This works only after submit and only on the next screen.

  • I want the parsing to happen immediately when the document is uploaded, so the address fields are prefixed/prefilled on the same screen without waiting for submit.

What I need:

  • Is there a supported OOTB way in Constellation to trigger GenAI parsing as soon as the attachment is uploaded and refresh the same form?

  • If not, is the recommended approach to build a custom DX component that combines:

    1. document upload,

    2. server-side GenAI parsing call,

    3. and immediate field prefilling in the same view?

What I am trying to achieve:

  • Upload attachment.

  • Call server-side GenAI parsing immediately.

  • Populate address fields in the same screen.

  • Avoid requiring submit just to run the parsing.

Any guidance, sample pattern, or best practice would be appreciated.

Hi Ram

Have you tried using flow action form refresh and having a Datapage with gen ai connect as source.it should work.

yes i have explored that option. flow action form refresh cannot accept attachment property as a refresh trigger.

Ok how about having another field (calculated field) which can be fired whenever this property value changes.

Declare expression of this new calculated field can refer this Datapage. Worth a try.

I recommend the following options,

  1. Use “Extract data from the Image” checkbox to trigger the form refresh settings.
  2. Use Screen flow to attach the document on 1st step and extract the content on 2nd step.