1 2 Previous Next 23 Replies Latest reply on Sep 29, 2016 11:13 AM by morganbleak

    Range Find using ...



      Range Find using ...


      I am trying not to use the full alphabet to do an Alpha find by using a Range (Example; A...E).  I have been working more than a week, trying to figure out how to use "Left (text ; number of Characters)" function so that the find doesn't include other words than the 1st letter of the 1st word in the field for all records in the found set.  Here is something that works but it includes other records because the find isn't finding just the 1st letter of the 1st word.  I need a little help in getting beyond the brick wall.  Enclosed is a screen shot of where I am today.  


        • 1. Re: Range Find using ...

          I cant follow that script, but this may help (from the brilliant mind of PhilModJunk:

          Try searching (for a to f)

          Enter Find Mode

          Set field [Table::field; ==A*]

          New Record/Request

          Set field [Table::field; ==F*]

          Perform Find

          If this gives you the proper results (it does for me), then you can change your script to grab the first parameter to put in the first set field, and the second parameter to put in the second set field.

          I'll have more time to pop back on later with more help if you don't get it solved.

          • 2. Re: Range Find using ...

            I would think that would find all records that start with A plus all those that start with F. I don't see how that would find A thru F, though I suppose  a looping script could set up a series of requests using criteria with A, B, C, ... F.

            For more examples of scripted finds, see: Scripted Find Examples

            • 3. Re: Range Find using ...

              Ahh you're right....didn't fully check it out.

              • 4. Re: Range Find using ...

                But for a simpler Range Find where you only want to specify this for the first word of the text in this field, define a calculation field with:
                LeftWords ( OriginalFieldHere ; 1 )

                and then do your "a".."f" range find on this calculation field.

                • 5. Re: Range Find using ...

                  Thanks Phil,  I now have a much simpler script.  Check out the image.  The "Set Field" is setting the 1st letter in the "Find Mode" for "Company Name" field, the "Perform Find" is using the "get script parameter" $GetPara to define the ranges: A...E, F...J, etc., depending on which button is clicked to run the script.  The problem I still have is that what the found set contains is beyond the 1st letter of each company.  When I click the A...E button I get: Apple, Amazon, AT&T, B&H, FileMaker, Gmail, Kahn Academy, X-Plane.  All I want are the names of the companies that have the 1st letter = A...E, click on the next button and I want F..J companies showing up in the found set.  I think I am not getting what is really being used to perform the "Found Set."  I had hoped that the Left(character; 1) would work to get it done.  Any more thoughts?

                  There is nothing in the examples that identifies how to get this done.  The examples talk about dates, which is the most often used script range finding.  

                  • 6. Re: Range Find using ...

                    Assuming no script triggers fire before your script ends, What if after your perform Find, Enter find mode, Set Field Internet::Company Name to ">"& Get(scriptparameter), then Constrain Found Set

                    • 7. Re: Range Find using ...

                      Thanks Steve, I'll look into that. Do you recommend a filter?  Why would this find go beyond what it seems to be asking for? Obviously I still don't understand what it is finding or controlling the finding.

                      • 8. Re: Range Find using ...

                        I think you missed my earlier suggestion to define a calculation field with leftwords. Your script can use set field to set search criteria to this calculation field instead of the original text field. 

                        • 9. Re: Range Find using ...

                          As I th no about this the perform find is still working on the records rather than working through or with the range restriction. Is this right?

                          • 10. Re: Range Find using ...

                            Hi Phil, No, I didn't miss what you had said, I wasn't able to arrive at a successful solution to my problem when I tried it, so I went another way.  I will go back to your suggestion and see what I come up with again.  I am not sure I have wrapped my little brain around how or which field to perform the find on actually works.  This is actually fun.

                            • 11. Re: Range Find using ...

                              Make sure that you select a Text result type, not number.

                              • 12. Re: Range Find using ...

                                Thanks Phil.

                                • 13. Re: Range Find using ...

                                  Phil, OK, I have made a new Field, calling it "SetFindField" Auto-enter Calculation with a Calculated Value of  Left ( originalField ; 1 ).  LeftWords allows other records in the found set that contain the other than the Range of "A...E", so that doesn't work well. But shouldn't this field now populate automatically when scrolling through the records due to the Auto-enter?  It doesn't do so, so it isn't giving me a found set.



                                  • 14. Re: Range Find using ...

                                    I didn't say to use an auto-enter calculation, but to use a calculation field. And leftWords should work just fine for this. It should return just the first word of the field and thus exclude all other words from affecting the results when you specify a range criteria using single letters such as "a...b".

                                    1 2 Previous Next