AnsweredAssumed Answered

Need dynamic field name in "IF" statement

Question asked by BrianOverby_1 on Nov 5, 2012
Latest reply on Nov 5, 2012 by BrianOverby_1


Need dynamic field name in "IF" statement


     I need to evaluate in an IF statement based off one of several fields. I know I have made this work before, but can't seem to remember. I have many flag fields, for example, Flag_1, Flag_2, and Flag_3. I want to evaluate the expression based on the field name and the script parameter. Here is the code..

      IF[ "Flag_"  & Get ( ScriptParameter )=1]

          Set Field By Name ["Flag_" & Get (ScriptParameter);0]


          Set Field By Name ["Flag_" & Get (ScriptParameter);1]

     End If


     The "Set field By Name" parts work fine, but not the "If" statement. Of course the script parameter is just a number like 1 or 2.