cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
338
Views
1
Helpful
2
Replies

JS Function on CVP Set Value Element

SAVA1994
Community Member

Hello Experts,

 

Please help us on the below scenario we are trying to add the JS function on the set value element , it seems something i have missed that, please correct me here, couldn't able to find right documentations for this expression

var obj = {Data.Session.status}

if(obj)

{

obj = obj.replace(/'g/,"")

// this obj object i need to store in session , how can store this 

data.setSession("obj",obj) or Data.setSession("obj",obj)  ---->>>> please confirm on this?

}

 

 

 

 

2 Replies 2

Can you explain what you're trying to do (I take it to get rid of a g)? Also, what version of Call Studio you're using?

janinegraves
Spotlight
Spotlight
The set value element creates a Local Variable based on the final value in the code of the Settings tab.
Then you can use the Data tab (create After) to assign {LocalVar.yourVarName}
Into Session data.



var obj = {Data.Session.status}

if(obj)

{

obj = obj.replace(/'g/,"")

obj //you need this so the value of obj is returned into your local car. else nothing will be assigned into the localvar

}




You can then assign the local variable value into session data in the Data tab (use create After).