Reference Attribute to String
So I am trying to take a reference attribute "Assistant" and convert it to a String to populate msexchAssistantName.
I thought I might be able to do it with an outbound sync rule in the FIM Portal, but I cannot seem to get the custom expression right. "Assistant".Value.ToString
I found alot of String to Reference docs online but not Reference to String.
any help is appreciated.
Thanks
February 9th, 2015 10:56am
Hello,
you can not do that in a Sync Rule as the lookup is not valid there.
But you can do that it a workflow, then Setting Workflow Data (Workflow Dictonary) Values which can then be used in Sync Rules as a String Value.
Use the lookup [//target/assistant/DisplayName] to set the value of workflow data.
Regards
Peter
February 9th, 2015 11:35am
Ok, I am very green on working with Workflows.
So I would create a new Action workflow,
Then would it be create object Action? Or would it be function?
Thanks for your help.
February 9th, 2015 11:43am
Hi,
ok sorry i forgot to get in detail.
Yes use an action workflow, with the function evaluator activity.
With this activity you can set or copy attribute values to other attributes or workflow data for example.
Easiest way might be to have an assisantDisplayName attribute on the use and set this value by using the activity.
trigger this activity with an MPR on modifyings of the assiatant attribute.
the solution with workflow data is a little more complex.
Regards
Peter
February 9th, 2015 11:51am
It will not allow me to target both Assistant and DisplayName
I tried the syntax [//target/assistant/DisplayName] gave an error, though the syntax [//target/assistant] works fine.
I am guessing because Assistant is a user reference attribute.
February 9th, 2015 2:31pm
February 9th, 2015 4:33pm
Hi Russell,
You will have to use the custom expression (for the value field) in the Function evaluator activity of your workflow and put [//Target/Assistant/DisplayName]. and in the destination field, you can put [//WorkflowData/AssistantName].
You can also create a new attribute "AssistantName" for the person object, and use it as the destination of the workflow.
Regards,
February 10th, 2015 4:18am
Sylvain,
Thank you, I was able to crerate the workflow. Now I need a little help with the MPR portion.. sorry I have worked with standard MPRs but not something like this.
So far I have
Type: request
Requestors: Relative - ResourceID
Operation: Modify Single Valued Attribute
Permission: Grants Permission
Target before and after: All Active People
Resource Attributes: Assistant; AssistantName
Policy workflow: Policy I created above "Assistant NAME"
Does this look correct? Sorry thanks for all your help.
February 10th, 2015 7:26pm
Hi,
You choose to use a "Relative" MPR so it's mean that your MPR will apply only when the user (itself) changes his assistant. Whatever, it's seems fine!
Regards,
February 10th, 2015 7:48pm
So you mean in Relative to Resource in the requestors option..
February 10th, 2015 7:56pm
Well it isnt working, no errors in my requests and no errors in event log, though the Workflow doesnt seem to kick off then I modify the Assistant Field for my profile or a standard users profile.
February 10th, 2015 10:07pm
<ns0:SequentialWorkflow x:Name="SequentialWorkflow" ActorId="00000000-0000-0000-0000-000000000000" WorkflowDefinitionId="00000000-0000-0000-0000-000000000000" RequestId="00000000-0000-0000-0000-000000000000" TargetId="00000000-0000-0000-0000-000000000000"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="clr-namespace:Microsoft.ResourceManagement.Workflow.Activities;Assembly=Microsoft.ResourceManagement, Version=4.1.3599.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<ns0:FunctionActivity x:Name="authenticationGateActivity1" FunctionExpression="<fn id="SingleValueAssignment" isCustomExpression="false"><arg>[//Target/Assistant/DisplayName]</arg></fn>"
Description="Exchange Assistant" Destination="[//WorkflowData/msExchAssistantName]" />
</ns0:SequentialWorkflow>
February 10th, 2015 11:19pm
The answer is yes and no, sorry about that:
- Yes, a WorkflowData can be a list of string or UniqueIdentifier
- No, you can't de-reference a multi-valued attribute with the OOTB workflow activities. You have to write your own custom activity.
And I never try to pass a such WorkflowData to a SR...
Regards,
February 11th, 2015 7:17am
ok,
so in the next activity
I set the destination
[//target/msExchAssistantName]
Then in concate, use a custom expression to populate the attribute?
February 11th, 2015 9:37am
Thank you all for your help..
It functions perfectly now.
Now only if I could figure out how to to this with direct reports.. :) Any ideas Sylvain?
:)
would like to populate a DirectReport Attribute with a multivalued list of everyone who has the viewed user set as the manager.
February 11th, 2015 9:46am
Hi,
you can do it the "simple" way if you want by just modify the RCDC for user create/view like this:
<my:Control my:Name="DirectReports" my:TypeName="UocListView" my:ExpandArea="false" my:Caption="DirectReports">
<my:Properties>
<my:Property my:Name="ColumnsToDisplay" my:Value="DisplayName,Description" />
<my:Property my:Name="EmptyResultText" my:Value="There are no groups according to the filter definition." />
<my:Property my:Name="PageSize" my:Value="7" />
<my:Property my:Name="ShowTitleBar" my:Value="false" />
<my:Property my:Name="ShowActionBar" my:Value="false" />
<my:Property my:Name="ShowPreview" my:Value="false" />
<my:Property my:Name="ShowSearchControl" my:Value="false" />
<my:Property my:Name="EnableSelection" my:Value="false" />
<my:Property my:Name="SingleSelection" my:Value="false" />
<my:Property my:Name="ListFilter" my:Value="/Person[(Manager='%ObjectID%')]" />
</my:Properties>
</my:Control>
This will give you a list of all poeple who have the current user set as the Manager.
Regards
Peter
February 11th, 2015 10:01am
Awesome! That was exactly what I was looking for.
thank you very much.
February 11th, 2015 11:08am
Your XOML seems OK, but you have to use the WorkflowData in a next activity in the same Workflow. Like setting a string value in a synchronization rule activity.
Regards,
February 11th, 2015 11:34am
Sorry to jump in Sylvain but you are providing important and useful information.
Let's say a user has the possibility to use several external applications. Each external application is an "Application" resource type in FIM.
In the user object we would have a multi-valued attribute holding the references to each Application he has. For sake of argument lets call the MV attribute ExternalApplications
Can a Workflow Parameter hold a list of strings?
How do we de-reference a multi-valued attribute using Workflow Parameters?
Would [//Target/ExternalApplications/DisplayName] really be a LIST of the names of each External Application?
Rgds,
a FIM novice
*HH
February 11th, 2015 2:32pm
Peter,
I was goi9ng over your blog, I found an issue from the above reference to string problem. When someone nulls out the assistant, the msExchAssistName Attribute remains populated.
So I found you blog
Would this work to pass a blank to the attribute if the Assistant was Deleted.
IIF(IsPresent(Assistant),[//WorkflowData/msExchAssistantName],Assistant)
Thanks
February 11th, 2015 3:35pm
I see.
So a custom workflow activity able to run powershell and given the user ObjectID should be able to use the FIM powershell cmdlets to dereference the mv user attribute and push back into the WF Dictionary a Workflow Parameter containing the list of strings.
Seems ok in theory.
February 12th, 2015 3:56am
Hi,
sadly there is no Delete Attribute Value in the function evaluator you can use to delete the portal string attribute when the assistant is deleted.
You have to write your own activity to do so.
As a workaround I often use a mv attribute with al Null value to send a delete to CS even if the portal has a value. So I always have a attribute nullString in MV schema, which will never be populated (so it is null)
You can then use a custom expression in the SYNCRULE like this:
IIF(IsPresent(Assistant),msExchAssistantName,nullString) => msExchAssistantName
The "dirty" thing on this is that the mxExchAssitantName Attribute will still have a value in portal even if assistant is removed.
You can also create such a nullString attribute in portal and use it directly in the workflow to delete the attribute value, which covers the "dirty" thing in the above part.
-Peter
February 12th, 2015 4:11am