In workflow editor, how do I call a record producer's unmapped variable in a script?

eduque
Giga Expert

I have a workflow (it sits and watches for records that fit a "wait for condition") and in one of my If activities, I want it to call a variable from the record producer that this workflow is designed to work off of.

answer = ifScript();

function ifScript() {

  if (producer.location_booked == 'Yes') {

  return 'yes';

  }

  return 'no';

}

location_booked is my yes/no variable inside the record producer. It doesn't seem to want to pull it. Any thoughts?

1 ACCEPTED SOLUTION

Deepak Kumar5
Kilo Sage

variables that are not mapped to fields are accessed as current.variables.<variablename>



answer = ifScript();



function ifScript() {


  if (current.variables.location_booked == 'Yes') {


  return 'yes';


  }


  return 'no';


}


View solution in original post

1 REPLY 1

Deepak Kumar5
Kilo Sage

variables that are not mapped to fields are accessed as current.variables.<variablename>



answer = ifScript();



function ifScript() {


  if (current.variables.location_booked == 'Yes') {


  return 'yes';


  }


  return 'no';


}