none
FIM String manipulation with declartive rules RRS feed

  • Question

  • I thought this would be easy, but apparently it isn't.  I have an attribute called HR_DISPLAYNAME fed from a database.  I need to split the sting into first name last name.  However, sometimes there is a middle initial, and sometimes a full middle name.  I tried this, but it fails:


    IIF(IsPresent(Word(HR_DISPLAYNAME,3," ")),Word(HR_DISPLAYNAME , 3, " "),Word(HR_DISPLAYNAME , 2, " "))

    Attribute HR_DISPLAYNAME

    FirstName LastName
    FirstNam MiddleName LastName
    FirstNam MI LastName

    Thursday, October 30, 2014 7:58 PM

All replies

  • Hello,

    some suggestion beside a solution to this, as I nearly never use such flows.
    Consider to provide the data directly in the data source on import, by calculate seperate fields in SQL ant import them into seperate attributes.

    I think this is a "better/good/best" practice, like Carol posts it some time ago too.

    http://www.wapshere.com/missmiis/fim-best-practice-present-data-to-the-sync-service-in-a-sync-ready-format

    Most the time this is more performant by the way, I've done this with a lot of data incl. Names, PhoneData and so on.

    Regards
    Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    Thursday, October 30, 2014 9:13 PM
  • Thanks, this actually is a really good point.  We have built a new View for the HR Data that does present a lot more information to FIM, so we can build very simple flows including first name and last name, employee ID, dn, etc.  However, I'd like to know how to do some string manipulations on the existing view.  It maybe handy to know.

    Friday, October 31, 2014 1:49 AM
  • Hi,

    you can  not archive you goal with a custom expression, as it seems to me that Word returns the following:

    - If there are 3 words Word(string,3," ") returns the word nr.3

    - If there are only 2 words Word(string,3," ") returns the whole string.
    (dont know why it it like this, would be better if it is empty then)

    - If string is empty or number <1 it returns an empty string

    So either IsPresent nor Eq="" expression will work, as Word(xx) will return a value in any of your cases.

    You can either import the Names directly seperated from HR or use code extension.

    The OOB function are currently very limited.

    Regards
    Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    Friday, October 31, 2014 8:58 AM
  • If I can't get clean data, I often use my workflow library to do more advanced data manipulation in the FIM Service - see https://fimactivitylibrary.codeplex.com

    The Code Run activity could help you with the string manipulation (if you can write a few lines of C# code, that is)


    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt

    Saturday, November 1, 2014 11:18 AM