# Complimentary attributes - filtering list items dependent upon selected item of another list

**URL:** <https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128>\
**Category:** PM modules\
**Created:** [November 21, 2019, 3:20pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128 "2019-11-21T15:20:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattmill30](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mattmill30](https://www.dolibarr.org/forum/u/mattmill30)\
**Post date:** [November 21, 2019, 3:20pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/1 "2019-11-21T15:20:12Z")

</div>

I am trying to create product forms with dynamically populated lists with relevant options for selection by data entry officers.

The test-case I am using is stocking computer hardware and software. If the item ‘Type’ is Hardware, the ‘Category’ list should filter out Software categories and vice-versa.

I am attempting to use the ‘Select list’ syntax for a “list depending on another complementary attribute list”, with the Category list structured as:

> desktop,Desktop|options\_type:hardware  
> workstation,Workstation|options\_type:hardware  
> laptop,Laptop|options\_type:hardware  
> tablet,Tablet|options\_type:hardware

However, the Category list does not dynamically update subject to the selection of the Type list.

Can anyone advise whether the select list syntax I am using is correct, or should I be using an alternative field type than ‘Select list’ in order to achieve dynamic lists, or whether this is a bug?

_Category complimentary attribute_

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/b/b0ad092c7535da650d1aedb05d8c4c5fb4def77d.png)

---

<div class="post-metadata">

**Author:** ![mattmill30](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mattmill30](https://www.dolibarr.org/forum/u/mattmill30)\
**Post date:** [November 21, 2019, 3:21pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/2 "2019-11-21T15:21:55Z")

</div>

_Type complimentary attribute_

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/b/b9852a58287e1853323bd0b8b285a48a6a5a9864.png)

---

<div class="post-metadata">

**Author:** ![mattmill30](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mattmill30](https://www.dolibarr.org/forum/u/mattmill30)\
**Post date:** [November 21, 2019, 3:22pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/3 "2019-11-21T15:22:49Z")

</div>

As can be seen below, the Category list is not updated dependent upon the selection of the Type list.

---

<div class="post-metadata">

**Author:** ![mattmill30](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mattmill30](https://www.dolibarr.org/forum/u/mattmill30)\
**Post date:** [November 21, 2019, 3:23pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/4 "2019-11-21T15:23:47Z")

</div>

_Type: Hardware - Category list shows all entries (4x Hardware)_

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/6/601a09211824498abc013f1eb75c4ac39412ae60.png)

---

<div class="post-metadata">

**Author:** ![mattmill30](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mattmill30](https://www.dolibarr.org/forum/u/mattmill30)\
**Post date:** [November 21, 2019, 3:25pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/5 "2019-11-21T15:25:23Z")

</div>

_Type: Software - Category list still shows all entries (4x Hardware)_

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/a/aa0bf01ecc7eedc385526a78ecabe0f3736139b5.png)

---

<div class="post-metadata">

**Author:** ![mattmill30](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mattmill30](https://www.dolibarr.org/forum/u/mattmill30)\
**Post date:** [November 21, 2019, 3:26pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/6 "2019-11-21T15:26:25Z")

</div>

The Category list also saves incorrectly:

 ![image](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/1/172a682cd24b3e232e16bf2c7c40f04388e07e02.png)

---

<div class="post-metadata">

**Author:** ![mojavaid36](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@mojavaid36](https://www.dolibarr.org/forum/u/mojavaid36)\
**Post date:** [February 16, 2021, 11:56pm UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/7 "2021-02-16T23:56:01Z")

</div>

For those struggling with this, I finally got it to work.

**My First List**  
Label or translation key = Catagory  
Attribute code = catagory  
Type = Select list  
Value =

1,CPU  
2,Power Supply

(Note no spaces)

**My Second List** (is dependent on what is selected in the first list)

Label or translation key = Spec  
Attribute code = spec  
Type = Select list

Value =

1,AMD|options\_catagory:1  
2,Intel|options\_catagory:1  
3,750W|options\_catagory:2  
4,500W|options\_catagory:2

(Note No Spaces, Use Pipe Symbol, Use underscore, Use colon)

Basically we are saying If option 1 (CPU) is selected in the first list then only show AMD or Intel, If option 2 (power supply) is selected in the first list then only show 750W or 500W

---

<div class="post-metadata">

**Author:** ![erikvanberkum](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/erikvanberkum/32/2709_2.png) [@erikvanberkum](https://www.dolibarr.org/forum/u/erikvanberkum)\
**Post date:** [January 17, 2025, 3:33am UTC](https://www.dolibarr.org/forum/t/complimentary-attributes-filtering-list-items-dependent-upon-selected-item-of-another-list/18128/8 "2025-01-17T03:33:11Z")

</div>

Can anyone tell me if this feature is working in Version 20.0.3?  
I am not able to get the simple example above to work.
