Share via

How to use regular expression conditionally

buyani.mhlongo 30 Reputation points
2023-07-20T07:08:17.9166667+00:00

How to use regular expression in azure B2C conditionally in custom policies depending on the selected value in dropdownlist. e.g if "national_id" is selected apply certain expression on identificationNumber and if its "passport" apply different expression on identificationNumber

            <ClaimType Id="identificationType">
                <DisplayName>Identification Type</DisplayName>
                <DataType>string</DataType>
                <UserHelpText>Identification Type</UserHelpText>
                <UserInputType>DropdownSingleSelect</UserInputType>
                <Restriction>
                    <Enumeration Text="National ID number"
                                 Value="national_id"
                                 SelectByDefault="true" />
                    <Enumeration Text="Passport Number"
                                 Value="passport" />
                </Restriction>
            </ClaimType>
            <ClaimType Id="identificationNumber">
                <DisplayName>National ID or Passport Number</DisplayName>
                <DataType>string</DataType>
                <UserHelpText>National ID or Passport Number</UserHelpText>
                <UserInputType>TextBox</UserInputType>
            </ClaimType>
Microsoft Security | Microsoft Entra | Microsoft Entra ID

Your answer

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