none
CustomExpression with Nested IIF RRS feed

  • Question

  • Currently I am using this CustomExpression and it works well

    IIF(Eq(FIMneisdGrade,"01"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"02"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"PK"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"K"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"EC"),FIMneisdEmployeeNumber,accountName)))))


    I am trying to add one more condition like below, but keep getting error "The function is not correctly formatted."

    IIF(Eq(FIMneisdGrade,"01"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"02"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"PK"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"K"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"EC"),FIMneisdEmployeeNumber,IIF(Eq(accountName,Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),accountName))))))


    accountName is normally Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,4)

    however because of naming conflicts sometime we need to use last 5 of FIMneisdEmployeeNumber

    Left(FirstName,1)+Left(LastName,10)+Right( FIMneisdEmployeeNumber,5)

    So im trying to say if the value is set to use the last 5, keep it that way (existing AD users).

    Any help would be great.

    -Charles







    • Edited by Kernel_32 Tuesday, September 30, 2014 11:32 PM
    Tuesday, September 30, 2014 11:27 PM

All replies

  • I threw your custom expression into notepad++, it looks like it was missing a bracket at the end. 

    IIF(Eq(FIMneisdGrade,"01"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"02"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"PK"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"K"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"EC"),FIMneisdEmployeeNumber,IIF(Eq(accountName,Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),accountName)))))))


    Wednesday, October 1, 2014 12:00 AM
  • added the last ) and received "Parameter of functino does not match."

    IIF(Eq(FIMneisdGrade,"01"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"02"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"PK"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"K"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"EC"),FIMneisdEmployeeNumber,IIF(Eq(accountName,Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),accountName)))))))

    Wednesday, October 1, 2014 1:10 AM
  • Is this custom expression in a Sync Rule or within a workflow? 

    If it's in a sync rule, are "FirstName" and "LastName" attributes in the metaverse? 

    Also your new custom expression was all wrapped within "Eq", so the bracket needs to be moved within the custom expression.

    IIF(Eq(FIMneisdGrade,"01"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"02"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"PK"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"K"),FIMneisdEmployeeNumber,IIF(Eq(FIMneisdGrade,"EC"),FIMneisdEmployeeNumber,IIF(Eq(accountName,Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5)),Left(FirstName,1)+Left(LastName,10)+Right(FIMneisdEmployeeNumber,5),accountName))))))



    Wednesday, October 1, 2014 1:39 AM