How to set Priority based on Category field?

Mytno1
Mega Contributor

So, it is like I have 1 category and 5 subcategory, each element in subcategory have a different value (1 or 2 or 3, it just like urgency and impact but it is subcategory) and these wil be used to calculate the priority field. I'm new to SN so I don't know much, How should I do it? Thank you.

If possible, may you show me how should I do it in detail? Like where to go, coding.. etc

Thanks

1 ACCEPTED SOLUTION

Here is the screenshot for your reference

find_real_file.png

Mark correct and helpful if this solves.

View solution in original post

15 REPLIES 15

Nitesh Balusu
Giga Guru

you'll have to use an on-change client script, configure the form, open client scripts, create a new one, select on-change.

In the script you'll have to get the value of the subcategory from the form and then calculate priority based on it.

 

Shubham Kakade
Giga Guru

Hello,

This can be achieved using client script.

Navigate to client script.

Refer the screenshot below

find_real_file.png

 

Mention your script logic in the scripting part.

Thank you.

Mark it as Correct/helpful if this helps you.

Regards,

Shubham

thank you, but can you help me with an example pls? I'm don't know much about java script 😛 
I can think about sth like newValue=='Email'{

  g_form.setValue('priority', 1);

}

but if I want to get the calculation, like the category priority value is 1point, subcategory1 is 2point, subcategory2 is 3p, like the impact and urgency, and it will be calculate so the Priority show value of average of them, so how should I do? 

TKS.

Hi,

Try below code

Write onSubmit() client script:

 

function onSubmit() {
 var a = parseInt(g_form.getValue('impact'));//here my field name is impact (set your field name instead of impact)
var b=parseInt(g_form.getValue('urgency'));//my second field name is urgency(set your name value instead of urgency)

var c=(a+b)/2;

alert('value'+c);
g_form.setValue('u_priority2',c);//here u_priority2 is my actual name of field(use your respective field name in which you want to show average)
  
}

let me know if you have any questions.

mark it as correct/helpful,if it helps you.

Regrads,

Ragini