We have a CSV file that contains a list of MAC Addresses and other data that we would like to retrieve and set as BES Client Properties. I have most of it working but I could use some help (and a sanity check) on the “Parameter for Email Address matching with parameter of MacAddress” section.
Goals:
- get a MAC Address and filter out VMNET bridges
- matching line in CVS against a MAC Address
- store values as a parameter
- set as client property
CSV File:
"A1-BC-23-45-D6-78","FirstName","LastName","FirstName.LastName@email.com","ID1Number","CompName","ID2Number","DeptName","UserName","TRUE","2015-11-02 08:06:27"
Parameter for MAC Address:
// Get MAC Address and filter out VMNET bridges
parameter "MacAddress"="{ (( mac address of it ) of adapters whose ( loopback of it = false AND address of it != "0.0.0.0" AND mac address of it as string does not start with "00-50-56-c0-00") of network) }"
Parameter for Email Address matching from known MAC Address
// Get Email Address using static Mac Address with static MAC Address
parameter "Email"="{ tuple string item 3 of (concatenation ", " of (substrings separated by "%22,%22" of (lines of file "data.csv" of (folder "C:\Users\username\Downloads\New folder\")) whose (it as string starts with ("%22A1-BC-23-45-D6-78%22,")))) }"
Parameter for Email Address matching with parameter of MacAddress
Not sure how to use escape brackets for relevance here and add the quotations to the parameter of MacAddress to match what’s in the CSV
// Attempt with Relevance substitution and not sure how to percent-encoding for a quotation mark on a parameter
parameter "Email"="{ tuple string item 3 of (concatenation ", " of (substrings separated by "%22,%22" of (lines of file "data.csv" of (folder "C:\Users\username\Downloads\New folder\")) whose (it as string starts with ( "{{parameter "MacAddress}")" )))) }"
Set client property
setting "Email_Address"="{parameter "Email" of action}" on "{parameter "action issue date" of action}" for client