True/False in reporting to Yes/No

Andrew_TND
Mega Sage
Mega Sage

Good afternoon again!

So, here's my problem.

I have a report which shows SLA's which have breached and this is indicated by a tick box (True/False)

When I report on this management don't like it. Is there a away I can change this to Yes/No? Or any particular work arounds?

The out of the box field is called has_breached

Appreciate it thanks

1 ACCEPTED SOLUTION

Hi Andrew, 

I replicated the same & it gives me data in reports as well.

If it is not working for you, then you can run a background script once & set the before update business rule to update this field.

 

var grSLA = new GlideRecord('task_sla');
grSLA.query();
while(grSLA.next()){
	if(grSLA.has_breached){
		grSLA.u_has_breached_string="Yes"; //set custom field value based on has breached field.
			
	}
	else{
		grSLA.u_has_breached_string="No";
	}
}

Thanks

Gaurav

View solution in original post

8 REPLIES 8

Gaurav Bajaj
Kilo Sage

Hi,

What you can do here is create a custom string field with the calculated value based on has breached field.

If its true, you can set it to Yes else No.

Please mark it correct/helpful based on the response.

Thanks
Gaurav

Worked beautifully, thank you. 🙂

That's the beauty of ServiceNow. Glad it helped.

When I run it through the reporting it just shows at empty. Is there anyway I can do it so it updates the choices?