is there any way to get all visible fields and visible variables on the form using a business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I have a task record that being created using a record producer.
Is there any way to get all visible fields and all visible variables on the form using a business rule.
The goal is to make a pdf file and attach it to the record that will contains all visible fields and visible variables and there corresponding values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
What's the use of a PDF containing all the visible fields on the form ?
All the data is already there, visible on the form, then why the PDF ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yes, it’s possible, but a Business Rule can’t directly know the client-side visibility of fields. You can use GlideRecord and dictionary metadata for fields, and access the record producer variables separately.
I’d recommend having the Business Rule call a Script Include that collects the required label/value pairs, generates the PDF, and attaches it with GlideSysAttachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yes, but not directly from a Business Rule. A Business Rule can read the record fields and variable values, but the form/UI controls visibility. You’ll need to reproduce the visibility logic server-side or use a suitable PDF/reporting approach to generate the attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
what's the business requirement here?
In server side you won't know which variables are visible or not.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
