- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:05 PM
how can I pass the incident category value dynamically in key value format
var inccategory = current.category.getDisplayValue();
var result = "{'category':inccategory} // this gives me error but if I print logs then I am able to see correct value
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:44 PM
Remove the quotes around the curly braces:
var result = {"category":inccategory};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:27 PM
then how to pass value of category in flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:29 PM
Please share where are you writing this code. screenshot please.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:30 PM
Flow designer is different. It really depends on where you are trying to access your incident record (flow, subflow, action, is it a trigger or a result of look-up, etc.), but basically you can get to it starting from the fd_data object.
For instance, if your incident is the trigger of the flow, it would look like this:
fd_data.trigger.current.category.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:36 PM
under actions I am trying to send value to 3rd party where am passing the value of category (label value) to key
var inccategory = fd_data.trigger.current.category.getDisplayValue();
gs.info('print category ' + inccategory); // gives me correct value
var result = '{"category":inccategory}'; // this part doesn't take above value instead it shows inccategory
return result;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2023 01:44 PM
Remove the quotes around the curly braces:
var result = {"category":inccategory};