Database filtering and grouping including caching of results

Dear Masters, I have already managed to implement this functionality with dropdown boxes, works fine - Thanks @russian-dima

However, I can’t make it with the so-called checkboxgroup, I have understood that several values are possible here, this is my checkbox:


$w('#CB1').options = [
{"label": "Burgenland", "value": "Burgenland"},
{"label": "Kärnten", "value": "Kärnten"},
{"label": "Niederösterreich", "value": "Niederösterreich"},
{"label": "Oberösterreich", "value": "Oberösterreich"},
{"label": "Salzburg", "value": "Salzburg"},
{"label": "Steiermark", "value": "Steiermark"},
{"label": "Tirol", "value": "Tirol"},
{"label": "Vorarlberg", "value": "Vorarlberg"},
{"label": "Wien", "value": "Wien"},
 ];

my start

import wixLocation from "wix-location";
import {session} from 'wix-storage';
import wixData from 'wix-data';

it should not work like this (is not a value = array) :roll_eyes:

$w.onReady(function () {
const title1 = session.getItem('bundesland1');  $w('#CB1').value = title1;
export function CB1_change(event) {SEARCH_ENGINE() ,session.setItem('bundesland1', $w('#CB1').value);  $w('#table1').refresh()}

can someone give me PLEASE a short coding sample, multiple selection and multiple storage must be possible, that’s my challenge here. Thanks and Thanks again <3
Yulia

Hello again,…

your checkbox is a CheckBox-Group, right?

When you talk of group, that means you have several values within this group, right?

What do you get, when you console-log ---->

console.log($w('#CB1').value)

And what do you get if you try to console-log just one value of this group ?

console.log($w('#CB1').value[0])

Or it is written like that…(i do not know exactly), but one of this should work.

console.log($w('#CB1')[0].value)

When you take a look here…

…you will recognize that the value of this checkbox-group is an ARRAY.

And how do you call values of an Array?

For example, let us say you have an Array with 5-items in it.

myArray = [a, b, c, d, e]

How to get result —> “c” ???

Yes of course —>

console.log(myArray[2])

a = 0
b = 1
c = 2
and so on…

EDIT: Perhaps you should also put in a link to your other post, to let see the relation between this post and the whole project.

Hiii again here <3 , ok i will lik it:
CheckBox-Group yes!
here the log result - i can see it in the log:

Aktive

Line 178

string

Line 179

item7 in action

Line 188

Gewähltes- Bundesland ( 0 ) = Niederösterreich

Line 191

Niederösterreich

Line 193

Gewähltes- Bundesland ( 1 ) = Steiermark

Line 191

Niederösterreich

Line 193

Gewähltes- Bundesland ( 2 ) = Vorarlberg

Line 191

Niederösterreich

Line 193

@kenanuenal No no no :grin:
To show console-logs is the only one case, where i say —> please use a pic (image) / screenshot, to show the console log.

Also do not forget to open all the data in the log, before taking a screenshot.

(Hat dich diese neue Erkenntnis etwas weiter gebracht?)

oiii, I despair a little … yes it has … but I miss the big picture. look here please:
ps: filter works fine, but when i jump to the dynamic page and then go back i lose all checkbox selections :slight_smile:

VIELEN DANK FÜR DEINE HILFE - DU HAST STARKE NERVEN MIT MIR

No reason to despair! Always keep trying. Sometime you need more than just a day, or even a week to find a solution.

But well what you are trying to do ?
You want to save/memorize entered FILTER-VALUES, so that you can switch between sites, and when you come back, you want that the FILTER shows the same FILTER-VALUES again, which were maden before switching the site(page), right?

So, on every changing in your serach-values, the corresponding value goes to LOCALE or SESSION, i do not know which one is better, but you will find it out here…
https://www.wix.com/corvid/reference/wix-storage

Look at the bottom of this example-page…
https://www.media-junkie.com/image-list
“cbg1” is —> C heck B ox G roup1
[i] is used in an loop
i=0
i=1
i=2
i=3

How often you have to loop??? How long is your array? (How much items are in that array???

"cbg1".value.length ---> gives a counting number of items in an array (array-length)
function CB1_change(event) {SEARCH_ENGINE() ,session.setItem('bundesland1', $w('#CB1').value);  $w('#table1').refresh()}

/Looping…(from given example)…

for (var i = 0; i < $w('#cbg1').value.length; i++) {
            console.log($w('#cbg1').value[i].toString())
 
            $w('#TXT1').text = $w('#TXT1').text + " / " + $w('#cbg1').value[i].toString()

            $w('#TXT2').text = "console.log( $w('#cbg1').value[i] )"
        }

Now back to sessions & Co…

session.setItem('bundesland1', $w('#CB1').value[0])
session.setItem('bundesland2', $w('#CB1').value[1])
session.setItem('bundesland3', $w('#CB1').value[2])
session.setItem('bundesland4', $w('#CB1').value[3])
session.setItem('bundesland5', $w('#CB1').value[4])

do the same in a loop…

for (var i = 0; i < $w('#cbg1').value.length; i++) {
    session.setItem('bundesland'+i, $w('#CB1').value[i])
}

@russian-dima noooooo :frowning: let me try it with a video answer:

left CBG Bundesland= #CB1
right CBG Sprachkenntnisse = #CB2 + #CB21 + #CB22 , because of fortging 3 groups

and here the project (code) - i can cry :sleepy:


import wixLocation from "wix-location";
import {session} from 'wix-storage';
import wixData from 'wix-data';

var selected

$w.onReady(function () {

const title1 = session.getItem('geschlecht');  $w('#DD1').value = title1;
const title2 = session.getItem('nationalitat');  $w('#DD2').value = title2;
const title3 = session.getItem('verfugbarkeit');  $w('#DD3').value = title3;
const title4 = session.getItem('ausbildung');  $w('#DD4').value = title4;
const title5 = session.getItem('berufserfahrung');  $w('#DD5').value = title5;

//const title6 = session.getItem('bundesland1');  $w('#CB1').value = title6;
//const title7 = session.getItem('sprachen');  $w('#CB2').value = title7;
//const title8 = session.getItem('sprachen');  $w('#CB21').value = title8;
//const title9 = session.getItem('sprachen');  $w('#CB22').value = title9;


$w('#CB1').options = [
{"label": "Burgenland", "value": "Burgenland"},
{"label": "Kärnten", "value": "Kärnten"},
{"label": "Niederösterreich", "value": "Niederösterreich"},
{"label": "Oberösterreich", "value": "Oberösterreich"},
{"label": "Salzburg", "value": "Salzburg"},
{"label": "Steiermark", "value": "Steiermark"},
{"label": "Tirol", "value": "Tirol"},
{"label": "Vorarlberg", "value": "Vorarlberg"},
{"label": "Wien", "value": "Wien"},
 ];

$w('#CB21').options = [
{"label": "Irisch", "value": "Irisch"},
{"label": "Italienisch", "value": "Italienisch"},
{"label": "Kroatisch", "value": "Kroatisch"},
{"label": "Lettisch", "value": "Lettisch"},
{"label": "Litauisch", "value": "Litauisch"},
{"label": "Maltesisch", "value": "Maltesisch"},
{"label": "Niederländisch", "value": "Niederländisch"},
{"label": "Polnisch", "value": "Polnisch"},
 ];

$w('#CB22').options = [
{"label": "Portugiesisch", "value": "Portugiesisch"},
{"label": "Rumänisch", "value": "Rumänisch"},
{"label": "Schwedisch", "value": "Schwedisch"},
{"label": "Slowakisch", "value": "Slowakisch"},
{"label": "Slowenisch", "value": "Slowenisch"},
{"label": "Spanisch", "value": "Spanisch"},
{"label": "Tschechisch", "value": "Tschechisch"},
{"label": "Ungarisch", "value": "Ungarisch"},
 ];

//--------------------------------------------------------------------------------
$w('#CB2').options = [
{"label": "Bulgarisch", "value": "Bulgarisch"},
{"label": "Dänisch", "value": "Dänisch"},
{"label": "Deutsch", "value": "Deutsch"},
{"label": "Englisch", "value": "Englisch"},
{"label": "Estnisch", "value": "Estnisch"},
{"label": "Finnisch", "value": "Finnisch"},
{"label": "Französisch", "value": "Französisch"},
{"label": "Griechisch", "value": "Griechisch"}, 
 ];

 //Datenspeicherung....
 //let Status = local.getItem('Status');                        $w('#DD0').value = Status; 
 //let Geschlecht = local.getItem('Geschlecht');                $w('#DD1').value = Geschlecht;
 //let Nationalitat = local.getItem('Nationalitat');            $w('#DD2').value = Nationalitat;
 //let Verfugbarkeit = local.getItem('Verfugbarkeit');          $w('#DD3').value = Verfugbarkeit;
 //let ausbildung = local.getItem('ausbildung');                $w('#DD4').value = ausbildung;
 //let berufserfahrung = local.getItem('berufserfahrung');      $w('#DD5').value = berufserfahrung;
 //let bundesland1 = local.getItem('bundesland1');              $w('#CB1').value = bundesland1;
 //let sprachen = local.getItem('sprachen');                    $w('#CB1').value = sprachen;
 
 //--------------------------------------------DropDownFelder_sichttbar_machen_start

    wixData.query("Team")
    .limit(100)
    .find()
    .then(results => {

 const uniqueTitles0 = getUniqueTitles0(results.items);
 const uniqueTitles1 = getUniqueTitles1(results.items);
 const uniqueTitles2 = getUniqueTitles2(results.items);
 const uniqueTitles3 = getUniqueTitles3(results.items);
 const uniqueTitles4 = getUniqueTitles4(results.items);
 const uniqueTitles5 = getUniqueTitles5(results.items);
 const uniqueTitles6 = getUniqueTitles6(results.items);
 const uniqueTitles7 = getUniqueTitles7(results.items);

    $w("#DD0").options = buildOptions0(uniqueTitles0);  //---> STATUS
    $w("#DD1").options = buildOptions1(uniqueTitles1);  //---> ANREDE
    $w("#DD2").options = buildOptions2(uniqueTitles2);  //---> NATIONALITÄT
    $w("#DD3").options = buildOptions3(uniqueTitles3);  //---> VERFÜGBARKEIT
    $w("#DD4").options = buildOptions4(uniqueTitles4);  //---> AUSBILDUNG
    $w("#DD5").options = buildOptions5(uniqueTitles5);  //---> BERUFSERFAHRUNG
    });

 function getUniqueTitles0(items) {const titlesOnly = items.map(item => item.status);        return [...new Set(titlesOnly)];}
 function buildOptions0(uniqueList0) {return uniqueList0.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles1(items) {const titlesOnly = items.map(item => item.anrede);        return [...new Set(titlesOnly)];}
 function buildOptions1(uniqueList1) {return uniqueList1.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles2(items) {const titlesOnly = items.map(item => item.nationalitat);  return [...new Set(titlesOnly)];}
 function buildOptions2(uniqueList2) {return uniqueList2.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles3(items) {const titlesOnly = items.map(item => item.verfugbarkeit); return [...new Set(titlesOnly)];}
 function buildOptions3(uniqueList3) {return uniqueList3.map(curr => {return {label:curr, value:curr};});}

 function getUniqueTitles4(items) {const titlesOnly = items.map(item => item.ausbildung);    return [...new Set(titlesOnly)];}
 function buildOptions4(uniqueList4) {return uniqueList4.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles5(items) {const titlesOnly = items.map(item => item.berufserfahrung);  return [...new Set(titlesOnly)];}
 function buildOptions5(uniqueList5) {return uniqueList5.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles6(items) {const titlesOnly = items.map(item => item.bundesland1);  return [...new Set(titlesOnly)];}
 function buildOptions6(uniqueList6) {return uniqueList6.map(curr => {return {label:curr, value:curr};});}

 function getUniqueTitles7(items) {const titlesOnly = items.map(item => item.sprachen);  return [...new Set(titlesOnly)];}
 function buildOptions7(uniqueList7) {return uniqueList7.map(curr => {return {label:curr, value:curr};});}

})
//-------------------------------------------------------------DropDownFelder_sichttbar_machen_ende

//----------- USER-INTERFACE / настройки ------------------------------------------- User-Interface
var DATABASE    = "database1"
var DATASET     = "#dataset1"
var REFERENCE1  = "status" 
var REFERENCE2  = "anrede" 
var REFERENCE3  = "nationalitat" 
var REFERENCE4  = "verfugbarkeit" 
var REFERENCE5  = "ausbildung"
var REFERENCE6  = "berufserfahrung"
var REFERENCE7  = "bundesland1"
var REFERENCE8  = "sprachen"
//---------------------------------- USER-INTERFACE / настройки -------------------- User-Interface

export function DD0_change(event) {SEARCH_ENGINE(), $w('#table1').refresh()}
export function DD1_change(event) {SEARCH_ENGINE() ,session.setItem('geschlecht', $w('#DD1').value);  $w('#table1').refresh()} 
export function DD2_change(event) {SEARCH_ENGINE() ,session.setItem('nationalitat', $w('#DD2').value); $w('#table1').refresh()}
export function DD3_change(event) {SEARCH_ENGINE() ,session.setItem('verfugbarkeit', $w('#DD3').value);  $w('#table1').refresh()}
export function DD4_change(event) {SEARCH_ENGINE() ,session.setItem('ausbildung', $w('#DD4').value); $w('#table1').refresh()}
export function DD5_change(event) {SEARCH_ENGINE() ,session.setItem('berufserfahrung', $w('#DD5').value); $w('#table1').refresh()}

export function CB1_change(event) {SEARCH_ENGINE() , $w('#table1').refresh()}
export function CB2_change(event) {SEARCH_ENGINE() ,session.setItem('sprachen', $w('#CB2').value); $w('#table1').refresh()}
export function CB21_change(event) {SEARCH_ENGINE() ,session.setItem('sprachen', $w('#CB21').value); $w('#table1').refresh()}
export function CB22_change(event) {SEARCH_ENGINE() ,session.setItem('sprachen', $w('#CB22').value); $w('#table1').refresh()}


export function BTNsearch_click(event) {SEARCH_ENGINE(), $w('#table1').refresh()}

async function SEARCH_ENGINE() { 
 let filter =  wixData.filter()  
 let item1, item2, item3, item4, item5, item6, item7, item8

 //DD1-DD5 = DropDowns
 if ($w('#DD0').value!=0) {item1 = $w('#DD0').value}
 if ($w('#DD1').value!=0)  {item2 = $w('#DD1').value}
 if ($w('#DD2').value!=0)  {item3 = $w('#DD2').value}
 if ($w('#DD3').value!=0)  {item4 = $w('#DD3').value}
 if ($w('#DD4').value!=0)  {item5 = $w('#DD4').value}
 if ($w('#DD5').value!=0)  {item6 = $w('#DD5').value}

 //DD1-DD5 = DropDowns
 if ($w('#CB1').value[0]!==undefined)  {item7 = $w('#CB1').value}
 if ($w('#CB2').value[0]!==undefined)  {item8 = $w('#CB2').value}
 if ($w('#CB21').value[0]!==undefined)  {item8 = $w('#CB21').value}
 //----------------------------------------------------------------------------------------------------------------------------
 // if(typeof item1=="string"){item1 = Number($w('#DD1').value)}
 // if(typeof item3=="string"){item3 = Number($w('#DD3').value)}
 
  console.log(item1)
  console.log(typeof item1)
 
 if (item1!=0)     {filter = filter.eq(REFERENCE1, item1)}
 if (item2!=0)     {filter = filter.eq(REFERENCE2, item2)}
 if (item3!=0)     {filter = filter.eq(REFERENCE3, item3)}
 if (item4!=0)     {filter = filter.eq(REFERENCE4, item4)}
 if (item5!=0)     {filter = filter.eq(REFERENCE5, item5)}
 if (item6!=0)     {filter = filter.eq(REFERENCE6, item6)}

 if (item7!==undefined)  {console.log("item7 in action") 
 for (var i = 0; i < item7.length; i++) {
            filter = filter.eq(REFERENCE7, item7[i])
            console.log("Gewähltes- Bundesland ( " + i + " ) = " + item7[i] )
            console.log($w('#CB1').value[0])
        }
    }
 else {console.log("Kein Bundesland ausgewählt")}

 if (item8!==undefined)  {console.log("item8 in action") 
 for (var i = 0; i < item8.length; i++) {
            filter = filter.eq(REFERENCE8, item8[i])
            console.log("Gewählte Sprache ( " + i + " ) = " + item8[i] )
        }
    }
 else {console.log("Keine Sprache ausgewählt")}

  console.log(filter)
 await  $w(DATASET).setFilter(filter)
   .then(()=>{
 let count = $w(DATASET).getTotalCount().toString();
       console.log("COUNT = " + count)
       $w('#treffer').text = count.toString()
    })

}

//----------------------------------------------------------------------------------------
//Resert_Button

export function resetfilter_click(event, $w) {
 
  $w("#DD0").selectedIndex = undefined;
  $w("#DD1").selectedIndex = undefined;
  $w("#DD2").selectedIndex = undefined;
  $w("#DD3").selectedIndex = undefined;
  $w("#DD4").selectedIndex = undefined;
  $w("#DD5").selectedIndex = undefined;
{
 let count = $w(DATASET).getTotalCount().toString();
       console.log("COUNT = " + count)
       $w('#treffer').text = count.toString()
    }
}

@kenanuenal
To be continued…

https://www.media-junkie.com/pflegeservice

@russian-dima God mode on - in love with you! Freue mich schon sehrrrr!!!

@kenanuenal :grin:

Ok, here it is (the last example) :grin:
https://www.media-junkie.com/pflegeservice

import wixData from 'wix-data';
import {local} from 'wix-storage';

//------------ USER-INTERFACE ----- настройки ---- Einstellungen--------------
var DATASET     = "#dataset1"
//------------------------------
var REFERENCE1  = "anrede" 
var REFERENCE2  = "nationalitat" 
var REFERENCE3  = "berufserfahrung" 
var REFERENCE4  = "verfugbarkeit" 
var REFERENCE5  = "ausbildung"
var REFERENCE6  = "bundesland"
var REFERENCE7  = "sprache"
//------------ USER-INTERFACE ----- настройки ---- Einstellungen--------------

var myFilter = []

$w.onReady(function () {
 //Lokale-Datenspeicherung....
 const title1 = local.getItem('geschlecht');         $w('#DD1').value = title1;
 const title2 = local.getItem('nationalitat');       $w('#DD2').value = title2;
 const title3 = local.getItem('berufserfahrung');    $w('#DD3').value = title3;
 const title4 = local.getItem('verfugbarkeit');      $w('#DD4').value = title4;
 const title5 = local.getItem('ausbildung');         $w('#DD5').value = title5;

 //const title6 = local.getItem('bundesland1');      $w('#CB1').value = title6;
 //const title7 = local.getItem('sprachen');         $w('#CB2').value = title7;
 //const title8 = local.getItem('sprachen');         $w('#CB21').value = title8;
 //const title9 = local.getItem('sprachen');         $w('#CB22').value = title9;
 
    $w('#CB1').options = [
    {"label": "Burgenland", "value": "Burgenland"},
    {"label": "Kärnten", "value": "Kärnten"},
    {"label": "Niederösterreich", "value": "Niederösterreich"},
    {"label": "Oberösterreich", "value": "Oberösterreich"},
    {"label": "Salzburg", "value": "Salzburg"},
    {"label": "Steiermark", "value": "Steiermark"},
    {"label": "Tirol", "value": "Tirol"},
    {"label": "Vorarlberg", "value": "Vorarlberg"},
    {"label": "Wien", "value": "Wien"},
    ];

    $w('#CB2').options = [
        {"label": "Englisch",       "value": "Englisch"},
        {"label": "Estnisch",       "value": "Estnisch"},
        {"label": "Finnisch",       "value": "Finnisch"},
        {"label": "Französisch",    "value": "Französisch"},
        {"label": "Griechisch",     "value": "Griechisch"},
        {"label": "Bulgarisch",     "value": "Bulgarisch"},
        {"label": "Dänisch",        "value": "Dänisch"},
        {"label": "Deutsch",        "value": "Deutsch"},
        {"label": "Irisch",         "value": "Irisch"},
        {"label": "Italienisch",    "value": "Italienisch"},
        {"label": "Kroatisch",      "value": "Kroatisch"},
        {"label": "Lettisch",       "value": "Lettisch"},
        {"label": "Litauisch",      "value": "Litauisch"},
        {"label": "Maltesisch",     "value": "Maltesisch"},
        {"label": "Niederländisch", "value": "Niederländisch"},
        {"label": "Polnisch",       "value": "Polnisch"},
        {"label": "Portugiesisch",  "value": "Portugiesisch"},
        {"label": "Rumänisch",      "value": "Rumänisch"},
        {"label": "Russisch",       "value": "Russisch"},
        {"label": "Schwedisch",     "value": "Schwedisch"},
        {"label": "Slowakisch",     "value": "Slowakisch"},
        {"label": "Slowenisch",     "value": "Slowenisch"},
        {"label": "Spanisch",       "value": "Spanisch"},
        {"label": "Tschechisch",    "value": "Tschechisch"},
        {"label": "Ungarisch",      "value": "Ungarisch"},       
    ];

 //DropDown-Benennung....(Betitelung)
    wixData.query("Team")
    .limit(100)
    .find()
    .then(results => {
 const uniqueTitles1 = getUniqueTitles1(results.items);
 const uniqueTitles2 = getUniqueTitles2(results.items);
 const uniqueTitles3 = getUniqueTitles3(results.items);
 const uniqueTitles4 = getUniqueTitles4(results.items);

        $w("#DD1").options = buildOptions1(uniqueTitles1);  //---> STATUS
        $w("#DD2").options = buildOptions2(uniqueTitles2);  //---> ANREDE
        $w("#DD3").options = buildOptions3(uniqueTitles3);  //---> NATIONALITÄT
        $w("#DD4").options = buildOptions4(uniqueTitles4);  //---> VERFÜGBARKEIT
    });

 function getUniqueTitles1(items) {const titlesOnly = items.map(item => item.anrede);        return [...new Set(titlesOnly)];}
 function buildOptions1(uniqueList1) {return uniqueList1.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles2(items) {const titlesOnly = items.map(item => item.nationalitat);      return [...new Set(titlesOnly)];}
 function buildOptions2(uniqueList2) {return uniqueList2.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles3(items) {const titlesOnly = items.map(item => item.berufserfahrung);   return [...new Set(titlesOnly)];}
 function buildOptions3(uniqueList3) {return uniqueList3.map(curr => {return {label:curr, value:curr};});}
 
 function getUniqueTitles4(items) {const titlesOnly = items.map(item => item.verfugbarkeit); return [...new Set(titlesOnly)];}
 function buildOptions4(uniqueList4) {return uniqueList4.map(curr => {return {label:curr, value:curr};});}

 function getUniqueTitles5(items) {const titlesOnly = items.map(item => item.ausbildung);    return [...new Set(titlesOnly)];}
 function buildOptions5(uniqueList5) {return uniqueList5.map(curr => {return {label:curr, value:curr};});}

})


//DD1-DD5 = DropDowns------------------------------------------------------
export function DD1_change(event)   {myFilter = myFilter + " / " + $w('#DD1').value,  SEARCH_ENGINE();}
export function DD2_change(event)   {myFilter = myFilter + " / " + $w('#DD2').value,  SEARCH_ENGINE();}
export function DD3_change(event)   {myFilter = myFilter + " / " + $w('#DD3').value,  SEARCH_ENGINE();}
export function DD4_change(event)   {myFilter = myFilter + " / " + $w('#DD4').value,  SEARCH_ENGINE();}
export function DD5_change(event)   {myFilter = myFilter + " / " + $w('#DD5').value,  SEARCH_ENGINE();}

export function BTNsearch_click(event)  {SEARCH_ENGINE();}

function SEARCH_ENGINE() { 
 let filter =  wixData.filter()  
 let item1, item2, item3, item4, item5, item6, item7

 //DD1-DD5 = DropDowns------------------------------------------------------
 if ($w('#DD1').value!=="")  {item1 = $w('#DD1').value}
 if ($w('#DD2').value!=="")  {item2 = $w('#DD2').value}
 if ($w('#DD3').value!=="")  {item3 = $w('#DD3').value}
 if ($w('#DD4').value!=="")  {item4 = $w('#DD4').value}
 if ($w('#DD5').value!=="")  {item5 = $w('#DD5').value}

 if (item1!==undefined)      {filter = filter.eq(REFERENCE1, item1)}
 if (item2!==undefined)      {filter = filter.eq(REFERENCE2, item2)}
 if (item3!==undefined)      {filter = filter.eq(REFERENCE3, item3)}
 if (item4!==undefined)      {filter = filter.eq(REFERENCE4, item4)}
 if (item5!==undefined)      {filter = filter.eq(REFERENCE5, item5)}
 //DD1-DD5 = DropDowns------------------------------------------------------

 //Checkbox-Group-1-----[ Bundesländer ]----------------------------------------------------
 if ($w('#CB1').value[0]!==undefined)  {item6 = $w('#CB1').value}
 if (item6!==undefined)  {console.log("Bundesland-filter aktiv.")    
 for (var i = 0; i < item6.length; i++) {
            filter = filter.eq(REFERENCE6, item6[i])
            console.log("Gewählte-Bundesländer ( " + i + " ) = " + item6[i] )
        }
    }
 else {console.log("Keine Bundesländer ausgewählt")}
 
 //Checkbox-Group-2-----[Sprachen ]----------------------------------------------------
 if ($w('#CB2').value[0]!==undefined)  {item7 = $w('#CB2').value}
 if (item7!==undefined)  {console.log("Sprachen-filter aktiv.")  
 for (var a = 0; a < item7.length; a++) {
            filter = filter.eq(REFERENCE7, item7[a])
            console.log("Gewählte-Sprachen ( " + a + " ) = " + item7[a] )
        }
    }
 else {console.log("Keine Bundesländer ausgewählt")}

    $w(DATASET).setFilter(filter)
    .then(()=>{
        console.log(myFilter)
        $w("#TXTfilter").text = myFilter
        result_COUNTER()
        $w('#table1').refresh();
    })
}

function RESET (parameter) {
    $w("#DD1").selectedIndex = undefined;
    $w("#DD2").selectedIndex = undefined;
    $w("#DD3").selectedIndex = undefined;
    $w("#DD4").selectedIndex = undefined;
    $w("#DD5").selectedIndex = undefined;
    $w('#CB1').value = undefined;
    $w('#CB2').value = undefined;
    myFilter = []
    $w('#TXTfilter').text = ""
}

//Result-Counter----------------------------------------------
function result_COUNTER() {
 let count = $w(DATASET).getTotalCount().toString();
    console.log("COUNT = " + count)
    $w('#treffer').text = count.toString()
}

export function BTNbundesland_click(event)  {if($w('#box2').hidden) {$w('#box2').show(), $w('#box4').hide()} else{$w('#box2').hide()}}
export function BTNsprachen_click(event)    {if($w('#box4').hidden) {$w('#box4').show(), $w('#box2').hide()} else{$w('#box4').hide()}}

export function BTNset_click(event)         {$w('#box2').hide(), SEARCH_ENGINE();}
export function BTNset2_click(event)        {$w('#box4').hide(), SEARCH_ENGINE();}

//Reset_Buttons----------------------------------------------------------------------------------------
export function BTNreset_click(event)       {RESET(), SEARCH_ENGINE();}
export function BTNreset1_click(event)      {$w("#DD1").selectedIndex = undefined, SEARCH_ENGINE();}
export function BTNreset2_click(event)      {$w("#DD2").selectedIndex = undefined, SEARCH_ENGINE();}
export function BTNreset3_click(event)      {$w("#DD3").selectedIndex = undefined, SEARCH_ENGINE();}
export function BTNreset4_click(event)      {$w("#DD4").selectedIndex = undefined, SEARCH_ENGINE();}
export function BTNreset5_click(event)      {$w("#DD5").selectedIndex = undefined, SEARCH_ENGINE();}
//----------------------------------------------------------------------------------------
export function BTNreset6_click(event)      {$w('#CB1').value = undefined, SEARCH_ENGINE();}
export function BTNreset7_click(event)      {$w('#CB2').value = undefined, SEARCH_ENGINE();}

export function BTNfilterVerlauf_click(event) {if($w('#box5').hidden) {$w('#box5').show('fade')}    else {$w('#box5').hide('fade')}}

export function BTNclose_click(event) {$w('#box5').hide('fade')}

The CODE is still not fully completed. You have to complete the “wix-storage”-function. And you can work and improve the new feature —> “Filter-Verlauf” if you need it.

Now everything should be given to understand how to set-up the wix-sorage-function. Take a good look onto the code especialy the parts (item6 + item7).

Du machst das schon :wink:

Good luck and happy coding.

Perhaps not to forget to put in the link to your other post…
https://www.wix.com/corvid/forum/community-discussion/from-successful-search-to-a-dynamic-page-no-return-possible-after-that-i-have-to-cry-please-support-me

@russian-dima you’re my hero, I will test it and post the final version also here … ты мой спаситель

@kenanuenal
Без проблем. :wink:

@russian-dima

@kenanuenal
Line-156-Fix:

$w("#TXTfilter").text = myFilter.toString()

@russian-dima thank you - did you watch my video to end? do you pls know a way how to get the selections back after jumping back to page from dynamic?

Which ones? Boxes, or dropdowns?

the boxes should be again selected and the dropdown should be also the same and based on the the “treffer” people should be the same

@kenanuenal
Ok, to be continued … :wink: