How to add long label questions on form?

Tapish Sharma1
Kilo Sage

Hi Folks,

I have a requirement to include questions on form. The questions comprise of one- two short sentences. What is the best approach to follow ? Shall I increase the column label length? or is there any other approach to it. 

1 ACCEPTED SOLUTION

onLoad Client Script to change question text (fieldname: question_1) in UI. The current script only works in UI and not in Service Portal but I think something similar can be done. Since it's DOM manipulation, need to uncheck "isolate script".

Increasing length of the question field may cause performance problem in the instance.

function onLoad() {
    try {
        setLabelOfInServiceCatalog('question_1', '1. I have a requirement to include questions on form. The questions comprise of one- two short sentences. What is the best approach to follow ? Shall I increase the column label length? or is there any other approach to it. ');
    } catch (e) {
        alert(e.message);
    }
}

function setLabelOfInServiceCatalog(fieldName, value) {
    var fieldId = g_form.resolveNameMap(fieldName);
    var label = gel('label_' + fieldId);
    $j(label).text(value);
}

Execution result:

find_real_file.png

View solution in original post

10 REPLIES 10

find_real_file.png

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Tapish,

If it's just 1 or 2 short sentences, is there any need to increase the length of the question?

Hi Hitoshi, 

The column label allows only 80 characters. There are few fields which require longer label lengths. I have just attached an example . There are many more question fields which I need to add which have longer texts

Hi,

It would be a global change and we always recommend not to make any changes to system fields and ask our clients to provide alternate text less than 80 chars. (Add help texts/toll tips to explain use of field)

But if still this is your requirement then you can increate the max_length of Labels.

find_real_file.png

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

If it's a service catalog form, can just add Annotation and Instructions and make it Always Expand.

find_real_file.png

Service Portal

find_real_file.png

Another option is not really recommended but to use DOM manipulation to insert questions.