Input Validation for Dialogbox field that allows multiple values

On a form, I have 2 fields, a dialog list field that allows multiple values, “Server”, and an editable text field “RegionalSecurityGroup”. I added an input validation formula in the “Server” field where if the Server field contains either “Atlanta”, “Boston”, “London”, “Pleasanton”, “Singapore”, “St. Louis”, or “Toronto”, the RegionalSecurityGroup cannot be blank. Also, if the RegionalSecurityGroup is filled in, the Server field must contain the values above.

When I tested this, I would receive the error message if I enter Atlanta, Boston and London in the server field and entered USA in the RegionalSecurityGroup field. I added the formula below. Can someone let me know why the formula isn’t working correctly. Thanks in advance!

@If(Server=“Atlanta”:“Boston”:“London”:“Pleasanton”:“Singapore”:“St. Louis”:“Toronto” & RegionalSecurityGroup = “”;

@Failure("If the Server contains either ‘Atlanta’, ‘Boston’, ‘London’, ‘Pleasanton’, ‘Singapore’,

‘St. Louis’, or ‘Toronto’, the Regional Security Group is required."); RegionalSecurityGroup != “” &

(Server = “” | Server != “Atlanta”:“Boston”:“London”:“Pleasanton”:“Singapore”:

“St. Louis”:“Toronto”); @Failure("If the Regional Security Group is filled in, the server name must contain either ‘Atlanta’, ‘Boston’, ‘London’, ‘Pleasanton’, ‘Singapore’,

‘St. Louis’, or ‘Toronto’."); @Success)

Subject: RE: Dialog box that allows multiple values

Your problem, I believe, is that = and != don’t do what you’re expecting when used with lists. So tell whether two lists contain any element in common, you could use = instead. Also, != returns true if any pair of matching elements (based on their positions in the two lists) is not equal. You want !(…=…) instead.

_rsgCities := “Atlanta”:“Boston”:“London”:“Pleasanton”:“Singapore”:“St. Louis”:“Toronto”;

_isRsgNeeded := (Server *= _rsgCities);

@If(_isRsgNeeded & RegionalSecurityGroup = “”;

@Failure(“If the Server contains one of '” + @Implode(_rsgCities; “', '”) + “', the Regional Security Group is required.”); RegionalSecurityGroup != “” & !_isRsgNeeded;

@Failure(“If the Regional Security Group is filled in, the server name must contain one of: '” + @Implode(_rsgCities; “', '”) + “'.”);

@Success)

Subject: RE: Dialog box that allows multiple values

Andre, thank you for your help. Your formula worked perfectly. I was wondering if I should have used *= but I didn’t understand how it would work. Can you explain it to me? Thanks again for your help.

Subject: RE: Dialog box that allows multiple values

Please see the Domino Designer help document “Operations on lists”. I don’t think I can explain it better than that.