- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
49m ago
Hello,
I want to streamline flows by not having to create "If" actions and then "Set Flow Variable" for multiple catalog variables
What I wish to do is have one action to "Set flow Variable", but then within that action set multiple variables using individual scripts for each one.
So in the example below I want to set the Flow Variable "3rd Party" only if the submitted form variable "
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
34m ago
Hi @jonathangilbert ,
Try the below script,
var third = fd_data._1__get_catalog_variables. which_3rd_party_do_you_work_for;
if(third){
return "They work for the the 3rd party "+fd_data._1__get_catalog_variables. which_3rd_party_do_you_work_for.name;
}
else{
return "";
}If my response helped, mark it as helpful and accept the solution.
Thanks,
Dinesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
34m ago
Hi @jonathangilbert ,
Try the below script,
var third = fd_data._1__get_catalog_variables. which_3rd_party_do_you_work_for;
if(third){
return "They work for the the 3rd party "+fd_data._1__get_catalog_variables. which_3rd_party_do_you_work_for.name;
}
else{
return "";
}If my response helped, mark it as helpful and accept the solution.
Thanks,
Dinesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
26m ago
What type of catalog variable is "which_3rd_party_do_you_work_for"? Is it a Reference, Select Box or Single Line Text variable?
The way we access the value can be different depending on the variable type.
Regards
Dimple Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
26m ago
Hello @jonathangilbert ,
May be when which_3rd_party_do_you_work_for is blank, (fd_data._1__get_catalog_variables.which_3rd_party_do_you_work_for.name) doesn't resolve to an empty string "", it resolves to the literal JavaScript value undefined.
and when you compare undefined != "", that evaluates to true, so your script falls into the has a value.
So try fixing the script :
var third = fd_data._1__get_catalog_variables.which_3rd_party_do_you_work_for.name;
var result = "";
if (third !== undefined && third !== null && third !== "") {
result = "They work for the 3rd party " + third;
}
return result;
also try to print the value using Log Action.
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
21m ago
HI Dinesh, this works perfectly , thankyou so much 🙂