How to add condition builder on UI Page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2017 02:04 AM
Hi,
I created an UI page and I wanted to add the condition builder on it.
I read this article Condition Builder and added these lines of code to my UI page:
Test 1:
<g:ui_element table="sys_script" field="collection" id="0e66a301dd2003003399d83d70be0205"></g:ui_element>
<g:ui_element table="sys_script" field="filter_condition" id="8a66a301dd2003003399d83d70be0211"></g:ui_element>
Test 2:
<g:ui_element table="x_doitw_msteams_ih_condition_builder" field="collection" id="c3a5264e4f13030009fdb5e18110c795"></g:ui_element>
<g:ui_element table="x_doitw_msteams_ih_condition_builder" field="condition" id="6b65a24e4f13030009fdb5e18110c717"></g:ui_element>
As you see, I tested it both with sys_script table and my custom scoped table (called x_doitw_msteams_ih_condition_builder) and in the first case it works, but in the second one - it doesn't.
My custom table is in a scoped application. It has a field of type "conditions" called "condition" and a field of type "table name" called "parent_table".
The condition field uses as a dependent field "parent_table" field.
I also want to make the table static. I don't want the user to be able to change different table. I just want he/she to be able to create a filter for my specific table.
That is why I added as a default value of "parent_table" field the name of my table.
I don't know is there a way not to use the first (table selection) input from the condition builder. For example, to autopopulate it and hide it or just to remove it (see on the picture).
Thanks in advance. If somebody has an advice, I will be glad to try it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2018 04:52 PM
Hey David,
Thank you so much for the reply, it works. However the <g:ui_element> isn't showing for some users. Do you happen to know why? Is there specific role for it?
Thanks again. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2018 06:39 PM
Don't bother it. I got it fixed. It turns out that users need read and write permissions on these fields.
All good. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2020 07:52 AM
I believe a client script with the following example should work:
createCondFilter("incident.s2id_sys_script.collection", "", "s2id_sys_script.collection");
The above code is similar to the call made when a Table Name field is updated. In the above scenario, for the "s2id_sys_script.collection" we would lookup the incident table.
You can try straight away from the browser's console the above code and see if the filter gets updated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2022 06:47 PM
Could anyone please provide an updated link to the Condition Builder article that the original question mentioned or, if it was scrubbed, an archived version of it? Thanks!