none
Converting Boolean to String in FIM Portal RRS feed

  • Question

  • Hi,

    Is there any easy way of converting a Boolean to String in the FIM Portal?

    So data flies into the FIM Portal as Boolean and leaves as String.

    Thanks,

    SK

    Friday, July 13, 2012 1:06 AM

All replies

  • Hi SK,

    Can you describe the scenario in a bit more detail?  By leaving the Portal as a string do you mean being imported into the Metaverse or being displayed to a user?

    Without knowing the exact scenario a potential soution could be having two attributes like myAttrBoolean and myAttrString. You could then keep the string value updated based on changes to the boolean. You could also use a rules extension to do a boolean to string conversion (depending whether you are more comfortable working within code or the Portal among other considerations)

    Andrew.

    Friday, July 13, 2012 1:22 AM
  • Thanks, let me explain.

    We read data from a SQL (HR) system, and a few of the attributes are boolean. There is a legacy application that this data needs to be written into, that does not support boolean attributes. So can FIM convert the boolean value into a string value (e.g. 'true')?

    If yes, perhaps there is some expression one could do it the FIM Portal to achieve this with?

    Regards

    Friday, July 13, 2012 1:57 AM
  • You should be able to do that in the outbound flow of the Synchronization Rule for your legacy application.

    Something like - IIF(myBooleanAttribute, "true", "false")

    Andrew.

    Friday, July 13, 2012 3:49 AM
  • Hi,

    Is this syntax correct for the following logic:

    If 'isActive' boolean attribute is true, then flow 'active' attribute to 'active' attribute,

    if 'isActive' boolean attribute is false, then flow "$" string +'active' attribute to 'active' attribute

    IIF(CustomExpression(Eq(isActive,"true")),active,CustomExpression("not"+active)) -> active

    Thanks,

    SK



    • Edited by D Wind Friday, July 13, 2012 6:09 AM
    Friday, July 13, 2012 6:04 AM
  • Looks about right to me - except you shouldn't need a custom expression to test the value of the boolean. Something like the below should work (I don't have an environment to test it out at the moment though).

    IIF(isActive, active, CustomExpression("not"+active))

    Cheers,

    Andrew.

    Friday, July 13, 2012 6:24 AM
  • That worked perfectly Andrew, thanks !!

    It worked for 3 out of 4 attributes. I have repeated this expression for 4 of our boolean attributes, but only 3 of them worked as expected. Is there some tool (like on scriptbox maybe) that can help me evaluate the expression with my MV data?

    thank you

    Friday, July 13, 2012 10:12 AM
  • Hi SK,

    I don't think that there's such a tool.

    Something worth checking: in the 4th case, does the attribute have a value? It could be null, in which case your rule should be something like

    IIF(IsPresent(isActive), 
      IIF(isActive, active, CustomExpression("not"+active)),
      "default value")

    Cheers,
    Paolo


    Paolo Tedesco - http://cern.ch/idm

    Friday, July 13, 2012 1:12 PM
  • Hi Paolo,

    When I type the above expression I get the following error:

    The function named CustomExpression could not be located

    I am trying to create this in the Outbound Sync Rule as a 'Custom Expression' (where the other 3 are working, except that for the others I am using the drop down options with 'IIF')

    Thanks,


    • Edited by D Wind Saturday, July 14, 2012 12:22 AM
    Saturday, July 14, 2012 12:19 AM
  • Hi SK,

    Sorry, I had just added a bit to Andrew's suggestion...

    Should be

    IIF(IsPresent(isActive),
      IIF(isActive, active, "not"+active),
      "default value")


    Paolo Tedesco - http://cern.ch/idm

    Monday, July 16, 2012 6:56 AM