4 Replies Latest reply on May 5, 2013 7:59 AM by philmodjunk

    Field text exact match script

    ChristopherThielking

      Title

      Field text exact match script

      Post

           Hello,

            

           I am trying to make a script for a solution that imports a file from another program, then searches one of the fields from the import and for every instance of one text replaces it with another text.

            

           The file which will be imported may be made by any number of people who may use any number of variations for the text, and the text refers to a real life object, of which there are a number of symilar models.

            

           What I would like is to use Loop, start at the first record, and test the field in question for numberous specific variations all at once and if there is an exact match to any one of them, then have it change the text in the field... so righ now here is what I have (broken down).

            

           Go to Layout ["layout name"]

             Show all records

           go to record/request/page [first]

           loop

           #-----------------begin if/then statements

           If [field name] = "1st derivations 1" or "1st derivation 2" or "1st derivation 3" or "1st derivation 4" (and so on)

           set field [field name; "new text"]

           End if

           If [field name] = "2nd derivations 1" or "2nd derivation 2" or "2nd derivation 3" or "2nd derivation 4" (and so on)

           set field [field name; "new text"]

           End if

           #-----------------there are about 20 different if/then statements on top of eachother like this

           Go to Record/Request/Page [Next; Exit after last]

           End Loop

            

           Right now the script goes through and since all 20 if then statments share atleast 1 portion of text as the same bit of text, it makes all of the records field in question the final return.