<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Dashboard with Dynamic Content Filter for Reservation Mgmt in CSM forum</title>
    <link>https://www.servicenow.com/community/csm-forum/dashboard-with-dynamic-content-filter-for-reservation-mgmt/m-p/3042773#M39772</link>
    <description>&lt;P&gt;I have a dashboard that has a calendar and uses a dynamic filter. That dynamic filter is build on a dynamic content / content block programmatic (script below). I have changed the building to be multi-select optional, but when in use, the filter only applies the first building selection. How can I get this to filter based on all selected buildings?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;
    &amp;lt;g:evaluate var="jvar_space_data" object="true" jelly="true"&amp;gt;

        var spaceData = [];
        var spaceGr = new GlideRecordSecure(sn_wsd_core.WPConstants.TABLES.SPACE);
        spaceGr.addQuery('region', gs.getProperty('sn_wsd_rsv.lrccd_primary_region_id'));
        spaceGr.addActiveQuery();
		spaceGr.addQuery('is_reservable',true);
        spaceGr.orderBy("region.name");
        spaceGr.orderBy("site.name");
        spaceGr.orderBy("campus.name");
        spaceGr.orderBy("building.name");
        spaceGr.orderBy("name");
        spaceGr.query();
        while(spaceGr.next()){
            spaceData.push({
                spaceId: spaceGr.getValue("sys_id"),
                spaceName: spaceGr.getDisplayValue("name"),
                buildingId : spaceGr.getValue("building"),
                buildingName : spaceGr.getDisplayValue("building"),
                campusId: spaceGr.getValue("campus"),
                campusName : spaceGr.getDisplayValue("campus"),
                siteId : spaceGr.getValue("site"),
                siteName : spaceGr.getDisplayValue("site"),
                regionId: spaceGr.getValue("region"),
                regionName: spaceGr.getDisplayValue("region"),
            });
        }
        JSON.stringify(spaceData);
    &amp;lt;/g:evaluate&amp;gt;
    &amp;lt;g:requires name="sn_wsd_rsv.lrccd_rsv_dashboard_filter.jsdbx" params="cache=$[jvar_stamp]" /&amp;gt;
    &amp;lt;style&amp;gt;
        .cont {
            margin-top: 20px
        }

        .filter-label {
            font-size: 16px;
            margin-top: 8px;
            margin-bottom: 5px;
        }
    &amp;lt;/style&amp;gt;
    &amp;lt;input type="hidden" id="spaceData" value="${jvar_space_data}"&amp;gt;&amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="siteStr" value="${gs.getMessage('Select a site')}"&amp;gt; &amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="campusStr" value="${gs.getMessage('Select a campus')}"&amp;gt; &amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="buildingStr" value="${gs.getMessage('Select a building')}"&amp;gt; &amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="spaceStr" value="${gs.getMessage('Select a room')}"&amp;gt; &amp;lt;/input&amp;gt;

    &amp;lt;div class="container"&amp;gt;

        &amp;lt;div class="row"&amp;gt;
            &amp;lt;div id="site-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Site')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="siteSelect" style="width: 100%"
                    aria-label="${gs.getMessage('Select a site')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div id="campus-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Campus')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="campusSelect" style="width: 100%"
                    aria-label="${gs.getMessage('Select a campus')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div id="building-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Building')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="buildingSelect" style="width: 100%" multiple="true"
                    aria-label="${gs.getMessage('Select a building')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div id="site-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Room')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="spaceSelect" style="width: 100%"
                    aria-label="${gs.getMessage('Select a room')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

&amp;lt;/j:jelly&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2024 22:20:44 GMT</pubDate>
    <dc:creator>JuliaHowells</dc:creator>
    <dc:date>2024-09-11T22:20:44Z</dc:date>
    <item>
      <title>Dashboard with Dynamic Content Filter for Reservation Mgmt</title>
      <link>https://www.servicenow.com/community/csm-forum/dashboard-with-dynamic-content-filter-for-reservation-mgmt/m-p/3042773#M39772</link>
      <description>&lt;P&gt;I have a dashboard that has a calendar and uses a dynamic filter. That dynamic filter is build on a dynamic content / content block programmatic (script below). I have changed the building to be multi-select optional, but when in use, the filter only applies the first building selection. How can I get this to filter based on all selected buildings?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;
    &amp;lt;g:evaluate var="jvar_space_data" object="true" jelly="true"&amp;gt;

        var spaceData = [];
        var spaceGr = new GlideRecordSecure(sn_wsd_core.WPConstants.TABLES.SPACE);
        spaceGr.addQuery('region', gs.getProperty('sn_wsd_rsv.lrccd_primary_region_id'));
        spaceGr.addActiveQuery();
		spaceGr.addQuery('is_reservable',true);
        spaceGr.orderBy("region.name");
        spaceGr.orderBy("site.name");
        spaceGr.orderBy("campus.name");
        spaceGr.orderBy("building.name");
        spaceGr.orderBy("name");
        spaceGr.query();
        while(spaceGr.next()){
            spaceData.push({
                spaceId: spaceGr.getValue("sys_id"),
                spaceName: spaceGr.getDisplayValue("name"),
                buildingId : spaceGr.getValue("building"),
                buildingName : spaceGr.getDisplayValue("building"),
                campusId: spaceGr.getValue("campus"),
                campusName : spaceGr.getDisplayValue("campus"),
                siteId : spaceGr.getValue("site"),
                siteName : spaceGr.getDisplayValue("site"),
                regionId: spaceGr.getValue("region"),
                regionName: spaceGr.getDisplayValue("region"),
            });
        }
        JSON.stringify(spaceData);
    &amp;lt;/g:evaluate&amp;gt;
    &amp;lt;g:requires name="sn_wsd_rsv.lrccd_rsv_dashboard_filter.jsdbx" params="cache=$[jvar_stamp]" /&amp;gt;
    &amp;lt;style&amp;gt;
        .cont {
            margin-top: 20px
        }

        .filter-label {
            font-size: 16px;
            margin-top: 8px;
            margin-bottom: 5px;
        }
    &amp;lt;/style&amp;gt;
    &amp;lt;input type="hidden" id="spaceData" value="${jvar_space_data}"&amp;gt;&amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="siteStr" value="${gs.getMessage('Select a site')}"&amp;gt; &amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="campusStr" value="${gs.getMessage('Select a campus')}"&amp;gt; &amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="buildingStr" value="${gs.getMessage('Select a building')}"&amp;gt; &amp;lt;/input&amp;gt;
    &amp;lt;input type="hidden" id="spaceStr" value="${gs.getMessage('Select a room')}"&amp;gt; &amp;lt;/input&amp;gt;

    &amp;lt;div class="container"&amp;gt;

        &amp;lt;div class="row"&amp;gt;
            &amp;lt;div id="site-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Site')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="siteSelect" style="width: 100%"
                    aria-label="${gs.getMessage('Select a site')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div id="campus-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Campus')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="campusSelect" style="width: 100%"
                    aria-label="${gs.getMessage('Select a campus')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div id="building-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Building')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="buildingSelect" style="width: 100%" multiple="true"
                    aria-label="${gs.getMessage('Select a building')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;

            &amp;lt;div id="site-container" class="col-md-3 col-xs-12 col-sm-12"&amp;gt;
                &amp;lt;div class="filter-label"&amp;gt; ${gs.getMessage('Room')} &amp;lt;/div&amp;gt;
                &amp;lt;select class="select2" id="spaceSelect" style="width: 100%"
                    aria-label="${gs.getMessage('Select a room')}"&amp;gt;
                &amp;lt;/select&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

&amp;lt;/j:jelly&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2024 22:20:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/csm-forum/dashboard-with-dynamic-content-filter-for-reservation-mgmt/m-p/3042773#M39772</guid>
      <dc:creator>JuliaHowells</dc:creator>
      <dc:date>2024-09-11T22:20:44Z</dc:date>
    </item>
  </channel>
</rss>

