need help with nested IIF
I am trying to build my displayname based on conditions. My company requires that we track citizenship and add something to the displayname if the person is either a non us citizen or has not yet proven their citizenship with the proper documentation (NPY). So, US citizen gets a "lastname, firstname", non-us gets "lastname, firstname (Foreign National)", and unknowns get "lastname, firstname (Citizenship Unverified)". So i though logically I would do this: IIF(NotEquals(country,"US"),IIF(Eq(country,"NPY"),"Citizenship Unverified","Foreign National","US")) I tried this code: IIF(NotEquals(country,"US"),IIF(Eq(country,"NPY"),(Lastname + ", " + firstname + " (Citizenship Unverified)"),(Lastname + ", " + firstname + " (Foreign National)"),(Lastname + ", " + firstname))) I get the error: parameter of function IIF does not match Is something wrong with my logic or my syntax? Thanks, Rich
May 13th, 2010 10:47pm

The structure of an IIF is IIF(condition, Do, Else) In your case, that would be IIF(condition1, Do1, IIF(condition2, Do2, Do3)) So, your if must be somewhere along the lines of: IIF(Equals(country, “US”), (lastname + “, “ + firstname), IIF(Equals(country, “NPY”), (lastname + “, “ + firstname + “Foreign National”), (lastname + firstname + “Citizenship Unverified”))) See "How Do I Synchronize Groups from Active Directory Domain Services to FIM" as reference. Under "Creating the synchronization rule", you can find a flow mapping for the scope attribute that has the same logic. Cheers, MarkusMarkus Vilcinskas, Knowledge Engineer, Microsoft Corporation
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2010 2:56am

Thanks Markus. That did the trick. Final working code below. Took a few tries to make sure I had parentheses in the right places. Final working statement was: IIF(Eq(country,"US"),LAST_NAME+", "+FIRST_NAME,IIF(Eq(Country,"NPY"),LAST_NAME+", "+FIRST_NAME+" (Citizenship Unverified)",LAST_NAME+", "+FIRST_NAME+" (Foreign National)")
May 14th, 2010 5:06pm

These posts might also be of use to you: http://www.ilmbestpractices.com/blog/2009/01/ilm-2-functions-all-in-one-place.html http://www.ilmbestpractices.com/blog/2009/01/ilm-2-functions-explained.html Since I posted these they have added two other functions Null() and ReplaceString(). Additionally the product group may have changed how a few things work so my examples may not work perfectly -- I need to go back and check them against RTM code. These functions can be used in the Sync Rules and in the Function Evaluator Workflow activity.David Lundell www.ilmBestPractices.com
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2010 8:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics