How to add help text to new attribute at list collector

Jayakrishna3
Tera Contributor

I have added new attribute to list collector If they choose specific attribute I need to show help text to them along with link.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @Jayakrishna3 

Please test the below script for single selection of the value and check.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
 
if(g_form.getValue('listcollectorvariableName').indexOf('sysId') > -1){ //sysId will be replaced with sys_id of the value selected in list collector
g_form.addInfoMessage("<a href='Link' target='_blank'>Help Text Details</a>");
}
 
}

View solution in original post

7 REPLIES 7

Community Alums
Not applicable

Hi @Jayakrishna3 ,

 

For a list collector type variable, there will be a list of values would be displayed , if the user chooses any one of them, it should display the help text and link.Can you confirm , if you are mentioning related to values or attributes

Jayakrishna3
Tera Contributor

Yes Monica

 

Yes Monica, Its values.

Community Alums
Not applicable

Hi @Jayakrishna3 

If you relating to the values selection on the list collector , please find the below onChange client script:

function onChange(control, oldValue, newValue) {
// Check if the new value
if (newValue === 'specific_attribute_value') {
// Display help text
g_form.showFieldMsg('your_field_name', 'Here is the help text. <a href="your_link" target="_blank">Learn more</a>', 'info');
} else {
// Clear the help text if a different attribute is selected
g_form.hideFieldMsg('your_field_name');
}
}

Please check, if this helps