- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 06:23 AM
I have a text field variable in catalog .
I want to set the text field value to the parent field of cmdb relationship table which is a reference field using flow designer.
Can someone suggest some solution .
Urgent requirement
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 07:20 AM
Hi,
not possible directly. but why to have it as text variable. If user doesn't give valid name the parent field cannot be set.
parent field is reference to cmdb_ci table so you will have to set sys_id in that field only
you will have to use inline f(x) script
script would look something like this
I assume user would enter name of CI which can be found in cmdb_ci table
var sysId = fd_data.trigger.current.sys_id;
var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', sysId);
gr.query();
if(gr.next()){
var name = gr.variables.enter_name;
var rec = new GlideRecord('cmdb_ci');
if(rec.get('name', name)){
return rec.getUniqueValue();
}
}
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 06:36 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 08:24 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:06 AM - edited 11-15-2022 01:10 AM
hi @Ankur Bawiskar sir my requirement is almost same but the difference is to create a change task using of change request record . and the change request field is a reference field
can u help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 01:27 AM
Can you post a separate question as this is quite older one? Please tag me there
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 10:22 PM
Hello,
Is there any specific need to keep the field as string instead of reference? Since for mapping the CI relationship (cmdb_rel_ci) between child & parent CI, the CI should be exists in your configuration item.
Parent - reference (ci)
child - reference (ci)
In the flow designer, before CI relationship creation please check whether already relationship exists or not. If not then create the relationship accordingly.
Thanks,
Priyanka R