Public Surveys - Associate with Case

Gpope
Tera Contributor

Hello Community, I'm facing this next issue: 

I've created a new Public Survey when a case is resolved. Since we are sending this surveys to external email users added as string on the case form, there is no ooo way to associate the Survey with the Case Number. 

 

I read many articles mentioning the possibility of creating a new survey question with the method value set to 'Default answer from script' and using this script:

 

 

 

var caseNum = RP.getParameterValue('caseNum') || '';
string_result = caseNum;

 

 

Lastly, it would be necessary to add to the Survey URL: 

 

&caseNum=${number}.

 

 

The URL is created perfectly with the correct caseNum, but in the Survey, the field does not get populated.

 

Gpope_0-1726515335505.png

 

 

Could someone help me?

3 REPLIES 3

Bert_c1
Kilo Patron

Seems:

 

var caseNum = RP.getParameterValue('caseNum') || '';

 

is returning a boolean value, try just:

 

var caseNum = RP.getParameterValue('caseNum');

 

RenderProperties-APIRP-getParameterValue

 

Gpope
Tera Contributor

Hi bert, 

 

It's returning empty Case Number field anyways: 

Gpope_0-1726578164744.png

 

Hopefully, some other Community member can assist you. One familiar with that API and how to use it.