Notification template - cannot get variables from HR case

Felipe Morais
Tera Contributor

Hello guys,

 

I am facing an issue with notifications for a HR admission process. Basically, i configured a notification to be sent when a new employee is admitted for the company, but i can't get the variables (like employee name) which are filled in the form (on the portal side) to put on the notification template. These variables (employee info) are at the end of the HR Case (HR_service=Admission) that is generated when filling the form (in the "Variables" related list).
For instance, a HR case as an example to better visualization of the what i am trying to explain:

FelipeMorais_1-1698764415148.png

I already tried to get from the "Select a variable"/"Fields" data-picker, but could not find that information in here.

FelipeMorais_4-1698764595564.png

The variables that i have (such as "${hr_profile.employee_name}") only return the information of the agent that is opening this case (not the new employee's). 

I tried to look on the XML of the HR case, but the "variables" (in which the new employee info are) is empty

FelipeMorais_5-1698764822421.png
Can someone help me with this? I have no idea where to get this information from

Thank you!
Felipe M.

3 REPLIES 3

-O-
Kilo Patron
Kilo Patron

variables is a "virtual" field, it does not contain data.

It loads its data only when called upon.

That said it will contain wildly diverse data depending on which Record Producer produced the case.

Or in case if the case has not been created using a Record Producer, it will contain no data.

That kinda' implies that you should limit your notification to those cases that have actually been produced by a given Record Producer.

In that case you will have access to those variables that are contained defined in that Record Producer (at the time of creation of the case record).

For debugging you can verify which producer created a case by loading the list of records in table sc_item_produced_record.

In there you will find which Record Producer has been used to create a case and once you know the identity of the Record Producer, you will know which variables will be available.

Jaspal Singh
Mega Patron
Mega Patron

Hi,

You can try using

${variables.first_day_of_leave}

where first_day_of_leave is the variable dictionary name. Replace with your variable name accordingly.

Sandeep Rajput
Tera Patron
Tera Patron

@Felipe Morais You will not be able to see the variable values in the XML as the variable data is actually stored in a separate table. The variables are also not available inside the data picker. You can access them via script/mail script using <hrCaseReference>.variables.<variable_name>.