7 Replies Latest reply on Oct 19, 2017 2:12 PM by Julian Wigman

    Filter a dropdown based upon user selection

    blwallace Specialist

      I have a window where I show all configuration items in a drop down list.  I want to add to the window checkboxes to allow the user to select what type of configuration item is listed.  For instance, a checkbox for Laptops would then only show laptops in the configuration items.  How would I go about doing this?

       

      Thanks,

       

      Bart

        • 1. Re: Filter a dropdown based upon user selection
          Julian Wigman ITSMMVPGroup

          You don't say if this CI field is on a top level (main window) object or on a collection, though the same rules apply.

           

          You'll need to be adept at creating filters on the CI related attribute in Business Object Designer (BOD) to accomplish this.  Martyn created a great article a while back on setting up conditional filters based on a checkbox which was mainly for associating CI's with the raise user versus showing all but the same concepts and building blocks apply.  Se How to filter CI item on user but be able to Disable/override the filter (un-link users and CI Items) on the incident window

           

          That said unless you are going to have a small number of these CI type related (Boolean) checkboxes, it could bloat your window design IMHO.  The way we conventionally do it is to have the CI Type dropdown on the window (usually filtered itself so that it excludes class types we don't want to initially see) which you set first (ie pick laptop) and then it filters the CI dropdown list accordingly.  the filters are also bi-directional as well so pick a CI first and the CI Type dropdown automatically sets to the correct type.

           

          So you'll have something like this on the window.  Not I also have linkage to User/CostCenter filtering as well on mine but you can ignore that bit.

          2017-10-18_09-01-20.jpg

          You select the Type...

          2017-10-18_09-01-36.jpg

          ...it then filters the CI's

          2017-10-18_09-02-04.jpg

          Julian

          @MarXtar

          • 2. Re: Filter a dropdown based upon user selection
            blwallace Specialist

            Yes, I agree with your comment on check boxes and have reevaluated my direction.  My process will be able to track assets that have been temporarily assigned to a person - a checkout list.  So I've created my Request window to include Asset Details with a Type and Asset dropdowns.

            Selection_029.png

            On ObjectDesigner->Request Management->Request->Configuration Item->Filter Selectors I created a new filter to filter as shown

            Selection_030.png

             

            Now when I select Type AccessCard, I get only access cards in my Asset dropdown.  When I select Type Laptop, I get only laptops in my Asset dropdown.  So far so good.

             

            Some of my laptops (and maybe future assets) are not available to be "checked out", so I want to filter the Asset dropdown list to show only those that are available to checkout.  I created a boolean attribute called Assignable? on the Laptop Configuration Management business objects and "ticked" it for one of my laptops.  I created a relationship in Request for both of these assets (dragged both down to Request).  In Request, I created a filter to show only those assignable laptops as follows

            Selection_031.png

            The filter only shows one laptop - the only one I've made assignable.  So far so good.

             

            However, when I go back to my Request process and run it, my Laptop dropdown shows all my laptops, not just BL1018.  I thought I had this one, but still need some assistance.

            • 3. Re: Filter a dropdown based upon user selection
              Julian Wigman ITSMMVPGroup

              Does your “ci_by_user_selected_class_type” filter ALSO include the ...

               

              AND Assignable is Equal To (True)

               

              .... line as well and screenshot suggests not.

               

              I don't understand why you have 2 filters.

               

              The boolean for “checked out” IMHO only needs to be on the CI object and doesn't also need to be on Request if that is what you mean as well. so i think lose that attribute and second filter if I understand correctly what you've done and just add the criteria from the second filter to the CI filter.

               

              Julian

              @MarXtar

              • 4. Re: Filter a dropdown based upon user selection
                blwallace Specialist

                I created the "ci_by _user_selected_class_type" filter with information from How to filter CI item on user but be able to Disable/override the filter (un-link users and CI Items) on the incident window using the first steps to create the filter.  I don't have "Assignable" as an attribute on Configuration Item, but as an attribute on AccessCard and Laptop.  So it's not available to use as criteria for this filter.  Do I need to make a relationship between Configuration Item and AccessCard (and Laptop?)?

                 

                Selection_032.png

                Selection_033.png

                Selection_034.png

                • 5. Re: Filter a dropdown based upon user selection
                  Julian Wigman ITSMMVPGroup

                  No what you should have done is create that checkbox on the top level CI object instead of Access Card so thwt the generic CI filter can access it.

                   

                  Welcome the the world of not-obvious gotchas!    Similar thing usually crops up with other parent object filters as well; GROUP being the classic when people have attributes on child objects Support Group, Customer, Company, Supplier etc.

                   

                  Julian

                  @MarXtar

                  • 6. Re: Filter a dropdown based upon user selection
                    blwallace Specialist

                    Ok, I guess that makes sense.  I was hoping to avoid having all my CI's be assignable, but when I create the attribute Assignable on the top level CI, I get filtered results.  Now I'm wondering if I need to create the attribute Assigned on the top level CI as well.  I want the window to only show, for a selected Ci type, items that are Assignable and yet are not Assigned.

                     

                    For me to put both of those attributes on the top level seems a bit odd - but hey, if that's the way it works...

                    • 7. Re: Filter a dropdown based upon user selection
                      Julian Wigman ITSMMVPGroup

                      Yes you put the attribute on the top level object but you only have to put the attribute on the child ci type windows where you need it.  Basically parent attributes as available to use on children but not vice-versa.

                       

                      The CI dropdown needs to cover any type of CI so any filters at that level also need to be ble to see attribute too.

                       

                      The filter needs to basically ignore the setting for CI types where it isn't appropriate/needed.

                       

                      Julian

                      @MarXtar