none
CustomExpression for Attribute Flow: Is it possible to use OR? RRS feed

  • Question

  • I've tested this numerous different ways.  I need to assign the domain attribute based on Loc_Code.  This works if I have just one code in there:  IIF(Eq(Loc_Code,"167"),"SSHCA","UCH").  This correctly sets the domain to SSHCA if that code is 167.  Is it possible to have multiple conditions?  For example:  IIF(Eq(Loc_Code,"167" OR "40"),"SSHCA","UCH").  It seems like it should work.  But, it evaluates as false every time and sets to "UCH".

    Thanks!


    Mike Leach | http://blogs.catapultsystems.com/mleach/default.aspx

    Monday, January 28, 2019 9:40 PM

All replies

  • So, I got this to work with multiple codes with this method:

    IIF(Eq(Loc_Code,"167"),"SSHCA",IIF(Eq(Loc_Code,"40"),"SSHCA",IIF(Eq(Loc_Code,"73"),"SSHCA","UCH")))

    Is this a reasonable way to do this if I have 10 codes to evaluate?  The only other way I can think of doing this is to leave the domain blank and use a Set and WF to add the domain.


    Mike Leach | http://blogs.catapultsystems.com/mleach/default.aspx



    Tuesday, January 29, 2019 4:41 PM
  • Hi Mike-

    You can use a script to generate a deeply nested IIF statement.

    Generally things like this work a lot better with a coded rules extension since you can do things like lookups from files. 


    Thanks,
    Brian

    Consulting | Blog | AD Book

    Wednesday, January 30, 2019 12:54 AM
    Moderator
  • Thanks.  I wish I had time before the release to do an extension.  I'm trying to decide if the MPR/Set/Workflow method is better than a deeply nested IIF.


    Mike Leach | http://blogs.catapultsystems.com/mleach/default.aspx

    Wednesday, January 30, 2019 5:33 PM
  • The IIF will be enforced as it's part of the sync engine. The Workflow is a fire and forget so it will only run if something triggers it in the portal. If the workflow ever fails you'll end up with drift in your data.

    If it were me I would do it with the sync rule.


    Thanks,
    Brian

    Consulting | Blog | AD Book

    Wednesday, January 30, 2019 5:35 PM
    Moderator