Question
Sorry to bug you all with this, but I've hunted all over for an example to use (can't find one) and I still don't understand how to write my own search queries well enough to do this myself. These things still look like greek to me. So how do I use the search function to dynamically generate a list of all users from a particular office (i.e. all users at the
TokyoOffice)? I found something sort of similar at
CambridgeOffice, but it isn't quite right since it references both a country and city and I haven't figured out how to modify it appropriately. Thanks in advance.
Environment
--
AmandaSmith - 22 Feb 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I fixed the example in
CambridgeOffice, it was broken:
%SEARCH{ "\* [C]ity\:.*Cambridge" regex="on" nosearch="on" format="$topic" separator=", " }%
This assumes bullet format on the user home pages. You can make the search also more strict, for example to list people in Cambridge USA, not UK:
"\* [C]ity\:.*Cambridge;\* [C]ountry\:.*USA"
If you use forms for user data it is much easier to query and format the output. Untested example:
%SEARCH{ "META:FIELD.*[C]ity.*Cambridge" regex="on" nosearch="on" format="| $topic | $formfield(Email) | $formfield(Phone) |" }%
--
PeterThoeny - 22 Feb 2006
Thanks! It didn't quite work in my case, but it was enough for me to figure out what modifications I needed to make for it to work. This is my working version, I've changed [C]ity to [L]ocation and changed the separator style to line breaks. Also, the actual office name is changed to protect the guilty.
%SEARCH{ "\* [L]ocation\:.*TokyoOffice" regex="on" nosearch="on" format="$topic" separator=" %BR% " }%
--
AmandaSmith - 23 Feb 2006