Convert String to Boolean for Attribute Mappings in Microsoft Entra ID

yeooandyni 106 Reputation points
2025-01-09T16:15:41.6766667+00:00

I'm trying to hide new hires from our GAL until the start date using the following expression:

IIF(DateDiff("d", Now(), CDate([StatusHireDate]))>=0, True, False)

This works in the expression builder, but when I save the mapping and provision a user on demand, it adds quotes around the 0, True, and False, modifying it to:

IIF(DateDiff("d", Now(), CDate([StatusHireDate]))>="0", "True", "False")

As a result, I encounter the following error in Entra when provisioning a user on demand: HybridSynchronizationActiveDirectoryInvalidParameter.

I've read the documentation and consulted Copilot, but nothing suggested has worked.

Any help would be appreciated, as this is quite frustrating.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,837 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sanoop M 80 Reputation points Microsoft Vendor
    2025-01-10T00:40:29.22+00:00

    Hello @yeooandyni ,

    Thank you for posting your query on Microsoft Q&A.

    Based on your issue description, I understand that you are trying to hide new hires from your GAL until the start date using the following expression:

    IIF(DateDiff("d", Now(), CDate([StatusHireDate]))>="0", "True", "False")

    As a result, you are encountering the following error in Entra when provisioning a user on demand: HybridSynchronizationActiveDirectoryInvalidParameter.

    Please note that Date-type attributes(for example, StatusHireDate) comes under the list of Unsupported scoping filters for Attribute Mappings.

    Please refer to the below Screenshot and the reference document which explains about the Unsupported scoping filters which comes under the list of one of the known issues for Attribute Mappings.

    User's imagehttps://zcusa.951200.xyz/en-us/entra/identity/app-provisioning/known-issues?pivots=app-provisioning#unsupported-scoping-filters

    Please note that there are some limitations and workarounds as mentioned below when you are using IIF functions for writing expressions for attribute mappings.

    Known limitations:

    This section includes limitations and workarounds for the IIF function. For information about troubleshooting user creation issues, see Creation fails due to null / empty values.

    • The IIF function currently doesn't support AND and OR logical operators.
    • To implement AND logic, use nested IIF statement chained along the trueValue path. Example: If country="USA" and state="CA", return value "True", else return "False". IIF([country]="USA",IIF([state]="CA","True","False"),"False")
    • To implement OR logic, use nested IIF statement chained along the falseValue path. Example: If country="USA" or state="CA", return value "True", else return "False". IIF([country]="USA","True",IIF([state]="CA","True","False"))
    • If the source attribute used within the IIF function is empty or null, the condition check fails.
      • Unsupported IIF expression examples:
        • IIF([country]="","Other",[country])
        • IIF(IsNullOrEmpty([country]),"Other",[country])
        • IIF(IsPresent([country]),[country],"Other")
      • Recommended workaround: Use the Switch function to check for empty/null values. Example: If country attribute is empty, set value "Other". If it's present, pass the country attribute value to target attribute.
        • Switch([country],[country],"","Other")

    Please refer to the below document for your reference.

    https://zcusa.951200.xyz/en-us/entra/identity/app-provisioning/functions-for-customizing-application-data#iif

    I hope the above information provided is helpful. Please do let us know if you have any further queries.

    If the above answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any additional questions about this answer, please click "Comment".

    Thanks and Best Regards,

    Sanoop Mohan


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.