March 17, 201411 yr Hi folks. I am having an issue creating a script. where part of it finds a word within a list (in a field). The word I am looking for is "Salary". However the list may contain lines that say one or more of "Salary", "Salary Increases" and "Salary Decreases". And I want to find if there is a line with just the word "Salary" in it. The patterncount function isn't doing the job as it will count (correctly) any of the three lines if they exist. Also, the order of the lines may change in each record so I can't tell the calculation to look on a particular line of the list. Is there a way to find just the word "Salary", ignoring the other two possibilities without actually scripting a Find? James
March 17, 201411 yr You speak of a calculation, a script and a find, all at once - as if they were the same thing. What is the actual goal here? And while I am at it: why do you even have a field with multiple values?
March 17, 201411 yr Author Update: Figured out a solution but it seems a little convoluted! Below is basically what I did. In reality this is part of a much larger Let function If ( Patterncount ( List_Field ; "Salary" ) = 3 and Patterncount ( List_Field ; "Salary Increases" ) = 1 and Patterncount ( List_Field ; "Salary Decreases" ) = 1 or Patterncount ( List_Field ; "Salary" ) = 2 and Patterncount ( List_Field ; "Salary Increases" ) = 1 and Patterncount ( List_Field ; "Salary Decreases" ) = "" or Patterncount ( List_Field ; "Salary" ) = 2 and Patterncount ( List_Field ; "Salary Increases" ) = "" and Patterncount ( List_Field ; "Salary Decreases" ) = 1 or Patterncount ( List_Field ; "Salary" ) = 1 and Patterncount ( List_Field ; "Salary Increases" ) = "" and Patterncount ( List_Field ; "Salary Decreases" ) = "" ; "True" ) Can anyone think of a better way to do this, out of interest?
March 18, 201411 yr Author Lol, sorry for the confusion Comment. It is a Set Field script step, with a calculation in it. The bigger picture is that there are a number of fields that can be updated in a table. If any of these fields are updated it runs a script that creates a list of the updated fields. This list is then used as part of a print layout to show the user what has been updated. This section looks in the list that has been created thus far to find if the Salary field has been updated already. If so, when the list is added to, the word "Salary" will appear in it. The reason I am recreating the list each time a field is updated is so I can keep it in alphabetical order. I hope that made a little more sense!
March 18, 201411 yr You should check out the FilterValues() function... (and perhaps the new Get(ModifiedFields) function too).
March 18, 201411 yr Author Thank you Wim, that solved it. Comment, I am sometimes amazed I understand what is going on my head some of the time!
Create an account or sign in to comment