Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

in the 'On Load' i am trying to solve this issue

1__TapasviSinK
Tera Contributor

When the Page is Loaded,Display the state value on the alert box and short description as (Incident number + category +channel)

 

function onLoad() {



alert('The state is' + g_form.getValue('state'));
g_form.setValue('short_description','number');
}

alert('The state is' + g_form.getValue('state'));
g_form.setValue('short_description','number');
}

5 ACCEPTED SOLUTIONS

Priyanka0402
Mega Sage

Hello @1__TapasviSinK 

Try using below script:

function onLoad() {
var state = g_form.getValue('state');
var incidentNumber = g_form.getValue('number'); 
var category = g_form.getValue('category'); 
var channel = g_form.getValue('channel'); 

// Display the state value in an alert box
alert('The state is ' + state);

// Set the short description
var shortDescription = incidentNumber + ' ' + category + ' ' + channel;
g_form.setValue('short_description', shortDescription);
}

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards

Priyanka

View solution in original post

Bhavya11
Kilo Patron
Kilo Patron

Hi @1__TapasviSinK 

 

Try this code, hope this will help you

 

alert('The state is' + g_form.getValue('state'));

var short = g_form.getValue('short_description');
var num = g_form.getValue('number');
var cat = g_form.getValue('category');
var contact_type = g_form.getValue('contact_type'); 

short = short + ' Incident number: ' + num + ' channel: ' + contact_type + ' category: ' + cat;// The + operator can be used between strings to combine them. This is called concatenation

g_form.setValue('short_description', short);

 

 

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."

 

Thanks,

BK

View solution in original post

abirakundu23
Giga Sage

Hi @1__TapasviSinK ,

Please follow below code:

abirakundu23_0-1721016225499.png

Please mark helpful & correct answer if it's really worthy for you.

View solution in original post

Satishkumar B
Giga Sage
Giga Sage

Hi @1__TapasviSinK 

 

check this:

 

function onLoad() {
var state = g_form.getValue('state');
var incidentNumber = g_form.getValue('number'); 
var category = g_form.getValue('category'); 
var channel = g_form.getValue('channel'); 

alert('The state is ' + state);

//short description 
var shortDescription = incidentNumber + ' ' + category + ' ' + channel;
g_form.setValue('short_description', shortDescription);
}

 

———————————————-
Please consider marking my reply as Helpful👍 and/or Accept Solution☑️, if applicable. Thanks!

View solution in original post

Harish Bainsla
Kilo Patron
Kilo Patron

Hi @1__TapasviSinK  check below code

function onLoad() {
var state = g_form.getValue('state');
var incidentNumber = g_form.getValue('number');
var category = g_form.getValue('category');
var channel = g_form.getValue('channel');
alert('The state is ' + state);
g_form.setValue('short_description', incidentNumber + ' ' + category + ' ' + channel);
}

View solution in original post

8 REPLIES 8

Priyanka0402
Mega Sage

Hello @1__TapasviSinK 

Try using below script:

function onLoad() {
var state = g_form.getValue('state');
var incidentNumber = g_form.getValue('number'); 
var category = g_form.getValue('category'); 
var channel = g_form.getValue('channel'); 

// Display the state value in an alert box
alert('The state is ' + state);

// Set the short description
var shortDescription = incidentNumber + ' ' + category + ' ' + channel;
g_form.setValue('short_description', shortDescription);
}

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards

Priyanka

Bhavya11
Kilo Patron
Kilo Patron

Hi @1__TapasviSinK 

 

Try this code, hope this will help you

 

alert('The state is' + g_form.getValue('state'));

var short = g_form.getValue('short_description');
var num = g_form.getValue('number');
var cat = g_form.getValue('category');
var contact_type = g_form.getValue('contact_type'); 

short = short + ' Incident number: ' + num + ' channel: ' + contact_type + ' category: ' + cat;// The + operator can be used between strings to combine them. This is called concatenation

g_form.setValue('short_description', short);

 

 

If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."

 

Thanks,

BK

abirakundu23
Giga Sage

Hi @1__TapasviSinK ,

Please follow below code:

abirakundu23_0-1721016225499.png

Please mark helpful & correct answer if it's really worthy for you.

I am only getting the State value not the label, can you please help me how i can get the label instead of State value.