Page 1 of 1

User defined rule looking up old column

Posted: 29 Sep 2015
by Kim Jeim
Hi,


We recently changed from using a "Choice" field to a "Lookup" field. The field was called Division (internal field name: "Division"). We cannot get rid of the old field because it was used in snapshots of the list (for trending data) for the last two years. I renamed the field "Old Division", and created a new lookup field, gave it an internal field name of "DivisionLookup" and then changed it to "Division". This is because the names of the divisions may change in the future.


I used [Division] in the user defined rule but it always seems to be looking for [Old Division], leading me to think it wants to use internal field names. If I use [DivisionLookup] it does not validate. Users are unable to see the proper forms for new list items because the "Old Division" field will be empty moving forward.


How do I tweak the user defined rule for that group of forms? Many thanks in advance.


Best Regards,

Tjon Kim

Re: User defined rule looking up old column

Posted: 30 Sep 2015
by rostislav
Value in the lookup field has a format of "ID;#Value", where ID is the id of the entry in the field and Value is it's display value. So your code would look something like this:

Code: Select all

[DivisionLookup] == '15;#Record Number Fifteen'
Alternatively, you can use the Contains function to match just the display value or just the ID, for example:

Code: Select all

Contains([DivisionLookup], ';#Record Number Fifteen')
Or for a more fine-grained approach, you can use a regular expression with Match:

Code: Select all

Match([DivisionLookup], 'your regular expression here')

Re: User defined rule looking up old column

Posted: 30 Sep 2015
by Kim Jeim
Thanks for response. I was not using internal field name the first time, that was why it was not working. Thanks! Why can you sometimes have [Assigned To] when the internal field name is [AssignedTo], without the space? Just for knowledge.

Re: User defined rule looking up old column

Posted: 01 Oct 2015
by rostislav
User defined group rules work the following way: field's InternalName is used and if it is not resolved, then Title is used.