Help with accessing Catalog Item variables from Document Template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 04:17 PM - edited 01-04-2023 04:18 PM
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 08:38 PM
Can you share what did you configure?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 09:24 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2023 10:45 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader