Forum Discussion

aaron's avatar
aaron
New Contributor
2 years ago

Conditional Mapping based on Value

Hi all!

Hoping someone could assist. My requirements is to map a specific email address from a list where type = "WORK". Example data:

{
"name": "xyz"
"country": "USA"
"emails": [ { "emailaddress": "x@gmail.com", "type": "WORK", }, { "emailaddress": "y@gmail.com", "type": "HOME", }, { "emailaddress": "z@gmail.com", "type": "PERSONAL", } ]
}

 the output of mapper should be:

{
"name"
: "xyz" "country": "USA" "emailaddress": "x@gmail.com" }

 I tried using ternary and a conditional snap but both didn't work so I probably got it wrong. 

thanks in advance!

  • Rod's avatar
    Rod
    New Contributor

    Hi Vish

    We are creating a new user object successfully but are having an issue with giving this new account a password. Can you shed any light on how to do this?

  • tae_kim's avatar
    tae_kim
    New Contributor

    I’m attempting to create user with a password as well but the userPassword field doesn’t seem to populate into it. Is userPassword not something that is accepted as a key attribute in the Active Directory snap in? It doesn’t give me an error when passing values in that attribute, but it doesn’t actually set any password. I assume the underlying connection is ldap calls and not using any dot net.

    Also I’m trying to find out how to pass in multiple array values.

    Also lastly, i want to get the object guid back, but it seems the snap-in pre-interprets the value by decoding with base 64 but provides it as a string (which is unusable) vs the byte array or even better decoded to bytes and properly providing the guid as the string value

    • Rudradip's avatar
      Rudradip
      New Contributor II

      Hi @tae.kim and @Rod were you able to solve the issue ? My use case is actually same : userpassword needs to be set and user needs to be forced to change it at the time of first login?

      • Rod's avatar
        Rod
        New Contributor

        OFFICIAL

        Hi Rudradip

        Post creation of the user account we used an Active Directory Update Entry snap

  • jnewhart's avatar
    jnewhart
    New Contributor

    @Rod - Thanks for posting this. I will add that I had to convert the randomly generated password into this unicode format (inserting “%u” before each 4-number sequence:
    e.g.
    t3St1ng!
    converts to
    %u0074%u0033%u0053%u0074%u0031%u006E%u0067%u0021