Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Help with accessing Catalog Item variables from Document Template

Jeff137
Tera Expert

Problem

I have created a Catalog Item on the sn_hr_core_case_workforce_admin table to collect values from a user for populating into a Document Template. I have created an HTML Document Template on the sn_hr_core_case_workforce_admin table, referencing the variables as ${variables.variable_names}. When using the preview function against a record produced from the catalog item, the values show as empty.

Jeff137_0-1672877329856.png

 

Troubleshooting

  • Using ${current.variables.variable_name} displays the text only, like the placeholder_start_date string.
  • Using a background/fix script, I have verified the variables exist and are readable.
  • No known related pending cross-scope access requests
  • Created additional cases to test against

Is there any known issue with this planned design? Can anyone provide advice on how to resolve this issue?

 

Thank you.

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Jeff137 

Can you share what did you configure?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Jeff137
Tera Expert

Hey Ankur. Thank you for your question.

 

I have created a catalog item with several variables. I have created a document template that references variables from the catalog item in the ${variables.variable_name} format. I have then attempted to verify read access to the variables for the document template by using the preview function and entering a record produced from the catalog item. The values are not displayed in the preview as illustrated in the screenshot in OP.

 

Can you elaborate on what further details I can provide to troubleshoot the issue?

@Jeff137 

it should work fine provided those variables are not part of any MRVS

check this link

Adding variables to the body of a HR Document Template breaks its preview 

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader