How can I update the field live based on other values of the record?

Sagar24
Tera Contributor

I have a string field on a form and I wanted to update this field value live based on the other values of the records. I tried calling script including in the 'Calculated value' & 'Default Value' of the dictionary. However, it seems no values are present in the current object and also not working as expected. Is there any other way I can do it?

 

But I want to update it live though? Please advise

3 REPLIES 3

Service_RNow
Mega Sage

Hi @Sagar24 

if you are updating the value in other table field then use after business rule

get the value by using current.field_name and update it in the other field.

 

Please mark reply as Helpful/Correct, if applicable. Thanks!

BalaG
Kilo Sage

Hi @Sagar24  if the fields you are changing (computing) and the field that is driving this change are on the same form (table)  you can do that with a onChange client script. It would be live in the sense that when the field value changes the dependent field will get updated once the focus moves from the first field.

 

See documentation here --> https://docs.servicenow.com/bundle/washingtondc-api-reference/page/script/client-scripts/concept/cli...

https://www.youtube.com/watch?v=uMGYjVVbHRo

 

Hope that helps

--

Bala Guthy

If this answer solved your issue please mark it as a solution or mark it 👍 helpful if it was of help.

Mark Manders
Mega Patron

What exactly are you trying to achieve? 

If, for instance, you want to add the CI to the short description when it changes, you could use a client script or scripted ui policy to achieve this, if you want it to be visible immediately.

If it's OK to have it done after saving, you could use a BR or flow to do the same. What needs to change (and more importantly: why does it need to change immediately). Not every requirement really makes sense and should be challenged, but if it does, go for the client side scripting (client script/ui policy).


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark