- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 01:09 PM
Hi All,
New to servicenow and business rules.
We have two tables - primary and secondary. Based on the drop down value selected in primary field, I have to create a new or update existing record in the secondary table to show that field in the secondary table.
- Should I create the rule on the primary table in this case?
- what would be the best way to get the values into the related fields in the secondary tables..
Thanks!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 11:37 PM
Hi,
Yes you can create Business rule on your Primary Table and in the script you can GlideRecord('Secondary Table') to create or update existing record in Secondary Table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 01:33 PM
Hi,
Yes, you should create the business rule or trigger a flow on the primary table update.
Not knowing the exact details I would lean towards a flow (no-code/low code) solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 11:37 PM
Hi,
Yes you can create Business rule on your Primary Table and in the script you can GlideRecord('Secondary Table') to create or update existing record in Secondary Table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 05:58 AM
Thank you for the responses. I tried creating the business rule on the primary table and using the GlideRecord on secondary table in the script section. I am now able to insert new records on the secondary table.
However, it is not showing me the correct related values in the secondary table records.
For instance, I have the following fields in the secondary table -
- Related Project Number
- Related Project Name
- Instance Version
These values are to be populated from the primary table (the respective project number and names and instance version values)
I can only see the project number in both the name and instance version fields though. PFA screenshot for reference.
Note: The instance version field is a choice list in the primary table. I just want to show the data (not necessarily as a choice list) in the secondary table, i.e. for the Project Number 123 & Project Name ABC, the instance version is XYZ.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2022 06:37 AM
So are you saying that same Project Number is also getting mapped to the Project Name and Instance version fields?