I'm looking for general guidance, not a complete solution. I have done minimal .NET (the foundation course on Microsoft Virtual Academy) and a bit of FIM.
Quick background:
One of our management agents currently exports (along with a number of unrelated attributes) three phone numbers into a CSV file, which is then imported into a distant cloud application.
Our phone systems rely on our phone number attributes in Active Directory (which is also integrated with FIM 2010 R2) to begin with the "+" character - mobile phones also need this so that they can call from any country. So, most phone numbers are prefixed with "+64" - New Zealand's international code. The export attribute flow is as follows (Metaverse attribute on the left, cloud .CSV on the right):
primaryExtn-> Extn
faxTelephoneNumber -> Fax
telephoneNumber -> Phone
Unfortunately, the earlier stated cloud app doesn't accept non-numeric characters (like the "+"), and this isn't an issue high on their list of "things to do".
So, I need to make sure that these telephone number attributes passed from the metaverse to the cloud .CSV do not contain a "+", and if it does, remove it before placing it in the .CSV file. I have come up with the basic code in C# so I don't need help here.
I will need to create a flow rule for this, but all of the examples I have found across the internet involving flow rules seem to use actual attribute names - snippets look like this:
if (!mventry["displayname"].IsPresent
name = csentry["FirstName"]
What I'd like to use in my code (since ideally I'll be created a flow rule that applies to three attributes), is something that goes along the following logic:
If ((the attribute that using the flowrule) contains "+"
{ attribute = attribute(replace("+"."") }
I don't know how to do the above. The other option would be to explicitly make references to each attribute, but that seems to waste code (again, this is pseudocode, I'm not worried about this at the moment):
if (mventry["primaryExtn"].Contains("+")
Extn = primaryExten.(Replace("+","");
if (mventry["faxTelephoneNumber "].Contains("+")
Fax= FaxTelephoneNumber .(Replace("+","");
if (mventry["telephoneNumber "].Contains("+")
Phone = telephoneNumber .(Replace("+","");
If that was all in one flow rule, wouldn't the attributes be changed three times (once per attribute passed through)? I haven't found anything exactly on the scope of a flow rule - what it can change.
The final option I can think of (probably the easiest, but again a waste of code) is to create three identical flow rules with different names, and put in the individual attribute names in per flow rule.
So I'm basically looking for guidance on how to refer to an attribute that is being actioned by the flowrule, rather than explicitly, or the best way to go about this.