How to fetch variables of one record producer in another record producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
We have two record producers creating similar HRC but for different use case. They uses some similar variables for locations, country, state. I want to fetch the variables values that from one record producer to another record producer and validate the value. Post validation, i want to apply those value and make them display or mandatory.
Till now, i have tried fetching the HRC itself but came to a realisation that variables do get stored in the HRC if they were created by a record producer.
How can i fetch those variables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
variables are always stored in question_answer table once Record producer is submitted
what do you mean by fetching variables from 1st record producer to another?
Do you want to auto populated variables on 2nd record producer based on 1st one?
if yes then you will require reference variable pointing to HRC Table and then use onChange client script + GlideAjax to bring the variable value and then set in your current form
💡 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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
There are two fields checkbox & selectbox in both the record producers.
if 1st RP gets selected with checkbox as true and selectbox with some choice, I want to display the same values in the 2nd RP.
i have tried fetching variables from HR case. How can i use reference variables in the glideajax?
getHRApprovalCheckandSelect: function() {
var universal = this.getParameter('sysparm_universal');
var getHRApprovalCS = new GlideRecord('sn_hr_core_case');
getHRApprovalCS.addQuery('parent', universal);
// getHRApprovalCS.addQuery('u_record_producer', gs.getProperty('rp.offer_position'));
getHRApprovalCS.orderByDesc('sys_created_on');
getHRApprovalCS.query();
if (getHRApprovalCS.next() && getHRApprovalCS.variables && getHRApprovalCS.variables.is_checkbox) {
var v = getHRApprovalCS.variables.is_checkbox.toString();
if (v === 'true' || v === '1' || v === 'Yes') {
value = '1';
}
}
return value;
Regards,
Kiran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
what do you mean by this line? share screenshots
if 1st RP gets selected with checkbox as true and selectbox with some choice, I want to display the same values in the 2nd RP.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader