- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 02:15 AM
A multiple choice variable request_type_action has two question choices. The question choices exist on the table question_choice. Starting from my request_type_action record, how do I access the 'text' field on the question_choice table?
I need to access it through a script in Flow Designer. I cannot dot-walk to the question choices, probably because they exist on a different table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 03:14 AM
Hi @kim-lindgren ,
Hope you are doing great.
To access the 'text' field on the question_choice table from your request_type_action record, try using below reference code:
var requestTypeActionSysId = current.request_type_action.toString();
var questionChoiceGR = new GlideRecord('question_choice');
questionChoiceGR.addQuery('question', requestTypeActionSysId);
questionChoiceGR.query();
while (questionChoiceGR.next()) {
var text = questionChoiceGR.text.toString();
// Perform further operations with the 'text' value
}
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 03:14 AM
Hi @kim-lindgren ,
Hope you are doing great.
To access the 'text' field on the question_choice table from your request_type_action record, try using below reference code:
var requestTypeActionSysId = current.request_type_action.toString();
var questionChoiceGR = new GlideRecord('question_choice');
questionChoiceGR.addQuery('question', requestTypeActionSysId);
questionChoiceGR.query();
while (questionChoiceGR.next()) {
var text = questionChoiceGR.text.toString();
// Perform further operations with the 'text' value
}
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 05:21 AM
Thank you!
With a few modifications (the toString() method on line 1 didn't work but I imported the sysID statically instead), this worked perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2023 05:31 AM
Great @kim-lindgren , thank you for your inputs.
Regards,
Riya Verma