How to use "Use dynamic default" functionality (

Chandra Singal2
Tera Contributor

Hi All, 

I would like to use "Use dynamic default" value functionality. 

1) We have a field called "Connection strength" in Relationship Table. It has choices as 

a) Always

b) Cluster

c) Infrequent

d) Occasional

2) Now based on condition example while creating relationships and type is contains :: conatains by in cmdb_rel_ci table ,I want to update "Connection strenth" field with "ingrequent". If type is uses :: used by, I want to update "connection strenth" as "Always".

Please let me for this requirement , how can I use "Use dynamic default" in field settings. 

3 REPLIES 3

suvro
Mega Sage
Mega Sage

In the dictionary you can use calculated value

There you can write script

switch(current.type){

case "sys_id of type contains :: conatains by" : return "infrequent"; break;

case "sys_id of type  uses :: used by" : return "always"; break;

case default: return "whatever default you want to set";

}

No his question is about using the dynamic default functionality and not writing server scripts in the default value field. 

suvro
Mega Sage
Mega Sage

Did my response resolve your query? If yes please close this thread by marking my response as correct and helpful so that other readers can also benefit. 

Otherwise let me know if you need more assistance.

 

Thanks and Regards,

Chandra Suvro Bose