Condition field on a form

MStritt
Tera Guru

I am looking to add a field (or anything) on our Account form, that displays the current running total (number) of open cases associated with that Account. I came across a conditions field (which I've created), but when I attempt to 'Add Filter Condition', I see:

find_real_file.png

find_real_file.png

find_real_file.png

Not sure where I need to config/select a table. I need to use the case table for this, so I can capture the total number of open cases against the account.

Unless, there is another way to accomplish this?? 

9 REPLIES 9

Hi,

Does your table customer_account have a field of type "Table"?

If yes then use that in the dependent field for the newly created Conditions field

If not then please create new field of type Table and then use in the dependent field for conditions field

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

OK. I created a new table field, and configured it to be dependent on our case table. And, configured the Conditions field to be dependent on the Open Cases field. How do I configure the conditions, to only show cases associated with the current Account I'm on? Every account will have this on it, and I only want active cases that are currently opened for that specific account. Also, anyway to only show the total number of case (112 in this instance) instead of showing the whole conditions, etc. Also, will this still work, if I remove the Open Cases field from the form (so it's not seen)? Or does it have to be on the form?

 

 find_real_file.png

 

And, it looks like I have to configure the table field (Open Cases) on every account record. When I went to another account, the table field did not have the case table (Case [sn_customerservice_case] selected.

find_real_file.png

Pooja Devkar
Mega Guru

Hello MStritt,

Condition field types

A condition field specifies when to run business logic such as a business rule or workflow.

There are two types of condition field.

Condition field types
Condition field type Description
Condition string A text field that accepts a plain JavaScript condition statement. The system validates the condition syntax for correctness before an update.
Conditions A field that adds a condition builder to a form. Condition builders require specifying a dependent field whose values the system uses to display choice list options. Typically, the dependent field is the Table field.

The system evaluates both types of condition field to determine if the conditions are true or false. When true, the system runs the business logic. When false, the system ignores the business logic.

To find dictionary attributes that affect condition fields, see Dictionary attributes.

Add the condition count to a condition field

The condition count widget can be activated on condition fields to display a preview of the records that would meet the current set of conditions. For fields where the condition count is activated, the number of records that match the conditions will automatically display. The count refreshes if the field the condition field depends on, such as Table, is changed. If the Table field is left blank, the widget is hidden.

Update a conditions field to use condition builder v2

In UI16, you can update a conditions field to display the version 2 condition builder.

Kindly mark my answer correct & helpful; if it's useful to you & if it solves your query.

Thanks & Regards,

Pooja Devkar

 

Stephen W_
Giga Guru

I realize this is an old question, but in case this helps anyone else:

Condition fields require a specific table definition to determine what attributes are available to the condition builder.

In some cases, such as task_sla, the table needs to be flexible since that condition will be applied to multiple types.  For that you'll need a table type field, "Table" in the image below, for example. You'll then set that as the 'Dependent Field' on your condition field's dictionary.
find_real_file.png


However, if your condition will only ever apply to a single table, you can simply add, "staticDependent=table_name" to the 'Attributes' field.
find_real_file.png