dp_119903
May 18, 2018Cirrostratus
Assign a variable based on AD query
I think I have this figured it but was hoping to get a sanity check.
I have an access policy that is querying AD. Later on I am sending an email to the user but there are two potential email fields.
If the user has f5EmailAddress as an AD attribute then I need to use that - if they don’t then I need to use session.ad.last.email.
I think this should just be a variable assignment after the AD query but I’m not sure if my syntax is correct.
Here’s what I have (forgive me in advance I’m writing this on an iPhone)
session.custom.company.email = if { ( [mcget {session.ad.last.attr.f5ProfileEmailAddress}] contains “@“)} { return ([mcget {session.ad.last.attr.f5ProfileEmailAddress }]} else { return ([mcget {session.ad.last.attr.email}])}