One field value depends on other field value

Andrii
Kilo Guru

Hi All,

I've used to solve this task with Data Lookup Rules previously, but this mechanism seems to be not very comfortble with Duration fields.

So, I have two fields and one of them - choice list. I'm looking for solution how to change second field value on a form when 1st changes.

Values for second field should be stored somewhere separately(Lookup Table).

The problem is - when I change Duration type field (2nd field) it gets into 1970-01-xx format and gets back to normal only after saving changes.

Is it possible to omit 1970-xx... display format while changing field value with Data Lookup Rules?

1 ACCEPTED SOLUTION

I've solved the issue using Integer field instead of Duration.


View solution in original post

6 REPLIES 6

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi,



Please refer the below link for more info.


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


Well, Thank you for video ... but that is, unfortunately, not my case.



I'm tasked withing Domain-separated environment and therefore - thinking of something more universal, prefering to use Data Lookup solution and would appreciate help with troubleshooting it.



So, here is the thing - 1st field is choice list values, second - duration.



the problem is - is that when I Personalize Dictionary and set 2nd field Read Only(which makes it show only Days) - it only changes value after insert/update but it displays new value correctly and user-friendly only after record has been updated.


RO.jpg


But I need a user to see a new value   of the 2ns field on a form every time 1st field changes - so I Personalize Dictionary one more time and unset Read Only. This allows Data Lookup Rules to change values on a form, but the way it display value is not user-friendly.



before 1st field changes:


notRO.jpg


after 1st field changes:


notROchanges.jpg



First of all - it is not clear to an End User that 4 stands for Days, and it is even more confusing when he changes values of 1st field and see 1970-01-03 in the second .... there is no clear information for End User in this field.


Hi Andrii,



Instead of setting your 2nd field Read Only by going to Personalize Dictionary and checking 'Read only', use UI policy to make it read only which will allow data lookup to change it the instance 1st field is changed similar to the priority field on the incident form which changes on change in impact and urgency.



I hope this solves your issue



Thanks,


Tanaji


Thank you Tanaji for your prompt reply,



and I also have tried UI Policy - I just didn't mention it because that wan't the issue - the issue is the way Duration field gets displayed.