Help to populate field using business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 05:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 05:54 AM
In business rule you can set value to a field using following options:
1) Actions tab - Select your field in Set field values and set the value
2) Advanced tab - You need to check advanced check box first. Set "when" as "before" in "when to run" tab and add code current.field_name='expected value'; in Advanced tab
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 05:59 AM
Hi
Can you please help me with below : I am stuck on step 2 .
Contextual Search Option
We need a field value on the form for the search to work. So the possible solution would be as follows
- Create a new field called “Additional Search Term” of type string on the table.
- Set up a business rule to populate the value for the new field as the same as the “Knowledge Base” display name. We do not have to display this field on the form.
- The on the table configuration, do not set up any filter (we do not want to compare the knowledge_base field on the article with any field on the table)
- On the search context, go to the Resource configuration tab then click on the record and click on the “Condition” from the Search context properties. On the condition field add the value as “kb_knowledge_base=<sysID of the knowledge base you want to display>”
- This would populate all the articles on the particular knowledge base on to the form
The below example shows all the knowledge articles from a particular knowledge base on a catalog task using the above set up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 06:05 AM
Hi,
Since you are stuck with your 2nd point then you can use below approach.
You can write before BR and use below script,
current.u_additional_search_term=current.kb_knowledge_base.getDisplayValue();
// change u_additional_search_term field name with your new field backend name and change 'kb_knowledge_base ' text with your kb_knowledge_base field backend name if needed.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 09:21 PM
Hi
I have done as suggested by but still I cannot see articles on form .