how to open a dynamic collection with a button

hi, i am trying to add code to a button so it will open a dynamic collection page from a dynamic item page . i have a dataset (named “families”) with birds (names) and families.


…/families/Swifts works ok in a browser.
that’s the code i am trying with no success:
import wixLocation from ‘wix-location’ ;

export function text22_click ( event ) {
let itemObj = $w ( “#dataset1” ). getCurrentItem ();
wixLocation . to ( “/families/” + itemObj [ “family_eng” ]);
}
wixLocation . to ( “/families/swifts” ); - works but its not dynamic
wixLocation . to ( itemObj [ “family_eng” );](wixLocation.to(itemObj[“family_eng”]):wink: - not working cause the url is incorrect but does return the value “swifts” in the error message
this is the error message i get:
“DatasetError: The dataset cannot filter by the dynamic dataset because the field used to build this page’s URL is empty”

will be grateful for any suggestion

figured it out. family names need to be changed to lowercase. thanks anyway