Using [ME] to Filter InfoPath Form Views Based on Form Metadata
Posted by Clayton Cobb on June 29, 2009
This is something that I ran into a while ago where I couldn’t seem to promote a field from my form into an existing Person/Group column in my form library. Even though the data in my field was correct (domain name or email address), I was unable to connect them due to the Publishing Wizard saying the data types don’t match. This happens even if you use a Contact Selector that has the AccountID attribute – it won’t match. So, I thought up using SharePoint Designer to pull the data from the promoted field in InfoPath and setting it as the value for an existing Person field. Doing it this way will only allow domain name (domain\username) and email address, but it works like a charm. Sure, you have a duplicate column with the same info, but you can just hide the promoted column from InfoPath in your View settings. Here is an article that someone else already wrote that shows how to do this step-by-step. I was going to write it, but someone beat me to it. =)
One thing to be VERY CAREFUL of is that when you use an SPD workflow to update a field, this is taken as an edit to the record. So, if your workflow is set to automatically run on edit of a record, then you will cause an infinite loop. To beat this, you have to put a condition on the Set Field in Current Item action that states “If <InfoPath promoted field> is not equal to <SharePoint Person Field>” or something to that effect and have an Else statement that simply “Stops the Workflow”. The problem is that the Person field consumes certain data (i.e. domain name) but displays other data depending on how the field is configured – the default is to show Name (with presence), which may cause the conditional statement not to work properly. You want the condition to stop the workflow if the Person field in SharePoint has already been set with the CURRENT info in the InfoPath promoted field. You can’t use the statement “If <SharePoint Person Field> is blank,” because the name may get changed in the form after creation.