5 Replies Latest reply on Mar 31, 2009 9:21 AM by philmodjunk

    Filtering a portal by the alphabet



      Filtering a portal by the alphabet


      I have a portal that displays a list of countries  - The list is huge - How can I establish a filter that will display each letter of the alphabet at a time.


      For example


      Have a number of tabs or buttons each being a letter of the alphabet and when you clikc on the "A" the portal will display all countries begining with A and so on and so forth


      Can this be done in FM




        • 1. Re: Filtering a portal by the alphabet

          By all means, shot this idea down ( anyone ) if its the worst approach. 


          Add another field to the Country table, that returns the first character of your Country field.

          Try => Left ( text ; numberOfCharacters ) // where numberOfCharacters is 1 and text is Country field



          Add a new field to your "other" table where you insert by drop down from a value list, or typing, a letter of the alphabet


          Let there be a relationship between whateverTableYou'reIn and Countries matching between letter-inserted and the above defined Left-calculated-field


          Well, thats a start at least, hopefully.  

          • 2. Re: Filtering a portal by the alphabet



            I am getting more and more familiar with this project :smileywink: !


            Given your other posts in other threads, you may want to insert your letters into the same return separated list of values we discussed yesterday.


            Then "Argentina" might have






            In its multivalue text field.


            Then, Argentina will be visible if the user selects, "All", "A", or "Active".

            If you are working with a lot of countries, you can use a Replace Field contents command or a script to load this text field with multiple values.

            • 3. Re: Filtering a portal by the alphabet

              Hi Phil


              Thank you for following up -  This is what I am doing with this and I need you to take a look at the below and tell me what is going on as it is not working.  I picked up this solution from another blog and it is exactly what I need if I get it to work


              So here I go


              Country table - Country 2 (TO) -  In the country table I have the following fields among other things

              pkcountryid - Auto enter serialnumber


              Galphabet - Global field

              Alphabet - regular text field


              The Alphabet regular text field is is auto enter calculation where

              Left (Country_Name ; 1)


              I don't know if the do not replace field if empty check box should be checked or unchecked?


              The relation has been established linking galphabet to alphabet -  The way I have established this for the portal to work is by relating the alphabet field in the main table to the galphabet in the TO??  Otherwise if I Do it in reverse then my portal does not display the countries?? 


              Can you verify this relation?


              In theory now I have a list of countries displaying on my country layout and with a script I can move up and down highlighting each portal row and displaying the relevant information on the right side of the screen this is all working


              Next step is to have buttons where each button is a letter of the alphabet so that If I click on A only the countries begining with "A" will display on the portal list.


              So to do this the instructions read to


              On the country layout if I create a button which will be labeled "A" -  This button is setfield left(country:galphabet ; "A") - Then in theory when testing it if I click on the button only the countries begining with 'A' should display


              But they are not!! :smileysad:


              Can you check and see if you can help me on this one




              • 4. Re: Filtering a portal by the alphabet

                Setup and test in the Table containing the field (calcution)

                Setup and test in another table (with the required relation).

                Your relationships are probably incorrect.

                • 5. Re: Filtering a portal by the alphabet



                  I'd define "field 3" as a calculation that returns text: Left(country_name; 1)


                  That way you don't have to do any replace operations, nor do you need to fix any values should you have to change the name of your country. (When Rhodesia became Zimbabwe, for example.)