none
Returning value from random object RRS feed

  • Question

  • Hi!

    I have a number of Exchange HomeMdbs associated with each OrgUnit as multivalued references.

    From the returned xpath (/OrgUnit[AccountName='Paris']/homedMdbs) - which will return fx. 5 homeMdbs, I would like to return a random HomeMdb and take the 'DisplayName' from the chosen HomeMdb and copy to the Users 'HomeMdb' attribute.

    Is this possible with the Update Resource function or do I need to use the execute Powershell function?

    Thanks,

    Søren

    Wednesday, May 3, 2017 11:37 AM

All replies

  • You can do this using Query feature of the Update Resources activity and  ValueByIndex, RandomNum and Count functions. Something essentially like this (without any error checking):

    Query: HomeMDBs  => /OrgUnit[AccountName='Paris']/homedMdbs

    ValueByIndex([//Queries/HomeMDBs/DisplayName], RandomNum(0, Count([//Queries/HomeMDBs]) -1)) => [//Target/HomeMdb]

    Wednesday, May 3, 2017 12:14 PM
    Owner