Is it possible to retrive record producer variable data after the record has been created?

Joshua Cassity
Kilo Guru

Our team uses record producers to create standard and normal changes from our service portal. I'm curious if after that process has taken place, are those record producer variables still able to be accessed to use in decision making?

Ex. Let's say we had a record producer asking the following questions:

1. "Do you enjoy soccer?" - u_soccer (Yes/No)

2. "Do you enjoy golf?" - u_golf (Yes/No)

Now let's say that I mapped the responses to the description field for whomever is working the change in question to see how they answered; However, if they answered 'Yes' to question 1, I'd like to kickoff a specific task to our soccer division to contact the user for a more targeted conversation.

Is it even possible for me to dive into the record producer's variables / responses to know that or would I have to make some kind of hidden field on the Change form 'Soccer' (Yes/No) and then set that field on the record that was created to determine that? I'm really hoping that I don't have to generate hidden fields because in alot of our change processes we want to use this kind of decision making.

Thanks.

1 ACCEPTED SOLUTION

What's the error message say?



Your if activity condition script should look like this:



answer = ifScript();



function ifScript() {


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


  return 'yes';


  }


  return 'no';


}



find_real_file.png


View solution in original post

14 REPLIES 14

It was defined as a Yes/No field so that would be my assumption.



And that current.variables.<variablename> will know to pull from the record producer's variables versus the field names on the change record it created?



If so, what happens when I attempt to pull this from a subflow of the main change flow. Do I need to define an Input Field and then in it's input string put 'current.variables.u_soccer'?


Hi Joshua,



Thanks for the clarification around the variable type. Correct, Yes/No variables store a literal string "Yes". Your comparison should be good there.



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



You shouldn't have to make any modifications to use it in a subflow, however not having a lot of experience using subflows or knowing what your subflow expects for input, you may need to set an input string.


That was my big kicker. Our change workflow is calling subflows based upon a select box that identifies the tasking necessary. I'll try to put in current.variables.<variable name> in the subflow and see if that works.



Would I be able to do a gs.log('The variable content is ', current.variables.<variable>) to see the value in the logs from the workflow?


A gs.log() statement is going to show up in System Logs> Script Log Statements. The logs related list in the workflow context is the output of a workflow Log activity. Either way, give it a try and see what the log produces and you'll have your answer.


I didn't put a log in yet but straight tried to use 'current.variables.u_database_retire' in the if statement above and I am getting an error message on the activity.



My brain is just frazzled at this ... lol.