How to automatically attach employee’s Collect Input responses to the related HR Task in LE

sanskarmish
Tera Contributor

Hi Experts,

I am working on HR Lifecycle Events where one of my activities is a Collect Input HR Task (Direct Deposit Setup).
When the employee submits their input, a record is created in the asmt_assessment_instance table.

 My requirement:

  • Once the employee submits the Collect Input form, I want to generate a PDF of their responses and automatically attach it to the related HR Task (sn_hr_core_task).

  • Ideally, after attaching the PDF, the HR Task should also be marked as Closed Complete.

    How can i  achieve this requirement is their any OOB feature.
    Thanks

1 REPLY 1

M Iftikhar
Mega Sage

@sanskarmish 

There isn’t an OOB feature that will automatically generate a PDF of Collect Input responses and attach it to the related HR Task. Collect Input stores the answers in the asmt_assessment_instance and related tables, but by default you can only view them from the task UI.

To achieve your requirement, you have two main options:

  1. Document Generation (preferred if available)

    • If your instance has the DocGen feature, you can create a Word/PDF template that maps to the assessment responses.

    • Use Flow Designer: When Assessment is completed → Generate Document → Attach to HR Task → Update Task state to Closed Complete.

    • This is the cleanest and most upgrade-safe approach.

  2. Custom Scripted Approach

    • Create a Business Rule on asmt_assessment_instance (after update, state = complete).

    • Query the related answers from asmt_assessment_instance_question.

    • Build the output in HTML/text.

    • Use sn_pdfgeneratorutils API (if plugin is active) or a custom HTML-to-PDF utility to generate the PDF.

    • Attach the PDF to the related sn_hr_core_task with GlideSysAttachment.write().

    • Finally, update the task state to Closed Complete.

Document generation methods

PDF generation API 

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.