AnsweredAssumed Answered

IIF function in Dynamic Value table

Question asked by stonejd on Sep 19, 2016
Latest reply on Sep 27, 2016 by stonejd

I am attempting to autopopulate a MunicipalID field (long integer) with a number between 1-21 depending on the value selected in a domain based text field. My initial thought was an expression in the dynamic value table using the IIF function. The first attempt was too long being a total of 765 characters, no spaces. I then tried to break it down into smaller chunks and assign a rule weight so that I could still use the IIF function. No matter how I write it I cannot get the expression to work. I am hoping that someone can either tell me what I am doing wrong or tell me a different way to accomplish this. My initial statement was as follows:


IIF([Municipality]="Bethel",1,IIF([Municipality]="Callicoon",2,IIF([Municipality]="Cochecton",3,IIF([Municipality]="Delaware",4,IIF([Municipality]="Fallsburg",5,IIF([Municipality]="Forestburgh",6,IIF([Municipality]="Fremont",7,IIF([Municipality]="Highland",8,IIF([Municipality]="Liberty",9,IIF([Municipality]="Lumberland",10,IIF([Municipality]="Mamakating",11,IIF([Municipality]="Neversink",12,IIF([Municipality]="Rockland",13,IIF([Municipality]="Thompson",14,IIF([Municipality]="Tusten",15,IIF([Municipality]="Bloomingburg Village",16,IIF([Municipality]="Jeffersonville Village",17,IIF([Municipality]="Liberty Village",18,IIF([Municipality]="Monticello Village",19, IIF([Municipality]="Woodridge Village",20,IIF([Municipality]="Wurtsboro Village",21,<Null>)))))))))))))))))))))

This, obviously, is too long but the chunks don't work either. I need to accomplish the following process.

  1. Select a domain description value from a drop down list (this part works fine as it is a manual process, not utilizing the dynamic value table.) Codes are a two letter value for the town, 3-6 letter value for the villages. Descriptions are as shown above in the IIF statement I was hoping to use. I tried using the code, as opposed to the description, in the IIF expression and that does not work either.
  2. Based on the selected value in the Municipality field the MunicipalID field should autopopulate with a corresponding number (as shown above in the expression).


I have tried, for the false result, a number of options including 0, Null, <Null>, 00, "", and not putting anything in that result. Nothing.


I set the "On Change Attribute" to TRUE, all others to FALSE, as that is the most appropriate for what I am trying to accomplish. When that didn't work I tried it with TRUE for the standard three and FALSE# for "On Manual" but that does not work either.


Any suggestions/help is greatly appreciated. I'm still fairly new at using the attribute assistant.