- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 06:39 AM
Hi Team,
I need to set short description field in SCTASK based on the variable of a catalog item.
If variable option chose as 'a' then short description should be read as 'need new project in a' .
if variable option chose as 'b' then short description should be read as 'need new project in b'.
This can be done in flow designer script so please tell me what can i write in that short description field script.
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 06:53 AM
Hello,
Please check the below approach to set the short description:
You have to use the Get Catalog variables action as shown below:
Then on Create catalog task action you can use:
Without script
Using script:
var getVariableValue = fd_data._1__get_catalog_variables.<your_variable_name>;
return "Need new Project for " + getVariableValue;
if(fd_data._1__get_catalog_variables.variable_a) {
return "Need new Project for " + fd_data._1__get_catalog_variables.variable_a;
} else if (fd_data._1__get_catalog_variables.variable_b) {
return "Need new Project for " + fd_data._1__get_catalog_variables.variable_b;
}
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 06:46 AM
Hi,
Try this in catalog task scripts -
if(current.variables.your_variable_name == "a"){
task.short_description = "need new project in " + current.variables.your_variable_name.getDisplayValue();
}else if(current.variables.your_variable_name == "b"){
task.short_description = "need new project in " + current.variables.your_variable_name.getDisplayValue();
}
else{
task.short_description = "need new project in ";
}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 07:20 AM
Thank you for your response Sagar.
Without scripting method worked given by Mahendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 06:53 AM
Hello,
Please check the below approach to set the short description:
You have to use the Get Catalog variables action as shown below:
Then on Create catalog task action you can use:
Without script
Using script:
var getVariableValue = fd_data._1__get_catalog_variables.<your_variable_name>;
return "Need new Project for " + getVariableValue;
if(fd_data._1__get_catalog_variables.variable_a) {
return "Need new Project for " + fd_data._1__get_catalog_variables.variable_a;
} else if (fd_data._1__get_catalog_variables.variable_b) {
return "Need new Project for " + fd_data._1__get_catalog_variables.variable_b;
}
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 07:19 AM
Hey Mahendra , thank you for the quick response.
Without scripting method worked. 🙂