none
Problems with nested IIF statements in FIM Service RRS feed

  • Question

  • I've been beating my head against this for some time, following examples I've found in web searches, but I cannot seem to make this IIF statement work after the first IIF function (inbound sync rule for Oracle database MA):

    IIF(Eq(IND_1,"X"),"Active",IIF(Eq(EMP_STATUS,"A"),"Active",IIF(Eq(IND_2,"X"),"Active",IIF(Eq(IND_3,"X"),"Active",IIF(Eq(IND_4,"X"),"Active",IIF(Eq(IND_5,"X"),"Active",IIF(Eq(IND_6,"X"),"Active","Inactive")))))))

    I've replaced most of the indicators with IND_1, but all were constructed something like "EMP_STATUS".  In every variation I've tried, the first IIF evaluation correctly evaluates the status true or false.  Anytime I add a nested IIF function in the "action if false" section, I get an error on that attribute when running the Oracle MA Sync if the first statement evaluates false:

    Error      sync-rule-mapping - expression

    Can FIM do nested IIF statements like this?

    Monday, August 11, 2014 6:59 PM

All replies

  • Hello Kevin,

    Yes FIM can do that. You must be sure that your tested attributes are not NULL to use them in custom expression.

    Regards,


    Sylvain


    • Edited by Sylvain.c Tuesday, August 12, 2014 7:03 AM
    Tuesday, August 12, 2014 7:02 AM
  • Yes, that turned out to be it.  If the attribute value is null or not applied to the MV object, it gives an error.  I rewrote this using IsPresent functions instead of most of the IIF functions.  Below is what worked (variables names replaced):

    IIF(IsPresent(IND_1),"Active",IIF(IsPresent(IND_2),"Active",IIF(IsPresent(IND_3),"Active",IIF(IsPresent(IND_4),"Active",IIF(IsPresent(IND_5),"Active",IIF(IsPresent(IND_6),"Active",IIF(IsPresent(IND_7),"Active",IIF(IsPresent(EMP_STATUS),IIF(Eq(EMP_STATUS,"A"),"Active","Terminated"),"Inactive"))))))))

    FIM would be a lot easier to work with if the errors actually gave you some idea as to the nature of the error rather than just generic "something went wrong" messages.

    • Proposed as answer by Mike Crowley Friday, August 15, 2014 5:03 AM
    Tuesday, August 12, 2014 8:42 PM