Using SharePoint's [Me] with AccountId produced by an InfoPath Contact Selector - InfoPath Dev
in

InfoPath Dev

Using SharePoint's [Me] with AccountId produced by an InfoPath Contact Selector

Last post 02-07-2012 05:54 AM by ferrx. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-06-2012 10:00 AM

    • ferrx
    • Not Ranked
    • Joined on 03-10-2011
    • Posts 16

    Using SharePoint's [Me] with AccountId produced by an InfoPath Contact Selector

    I have a field in an InfoPath form that uses a Contact Selector and saves the account id to a SharePoint list (i.e. "myDomain\jDoe")

    I want to create something like a "My Tasks" view in sharepoint that would typically use the [Me] function to filter. Since [Me] seems to be a Person or Group object, it can't be compared directly with a text string like "myDomain\jDoe". Anyone have any ideas as to how I can go about doing this? If there was an alternative to [Me] that produced the Account Id, or if there was some way to convert [Me] to the account id, that would work.

     As a work-around, I have considered creating my field in the list columns gallery as a Person or Group field prior to activating/adding the form to my site collection.. this MIGHT work as it may convert the incoming accountId into a a person or group object, but it isn't easy to test, so it's a last resort at the moment.

  • 02-06-2012 11:28 PM In reply to

    Re: Using SharePoint's [Me] with AccountId produced by an InfoPath Contact Selector

    Hmmm interesting problem.  You are correct that InfoPath will only allow promoting the field as a string instead of as a person type.  So your filters on [me] won't exactly work.  Depending on your scenario, could you use the Created By or Modified By fields that are auto populated by SharePoint?  This might be alot more work, but you might be able to use workflow to set the field for you.
    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 02-07-2012 05:54 AM In reply to

    • ferrx
    • Not Ranked
    • Joined on 03-10-2011
    • Posts 16

    Re: Using SharePoint's [Me] with AccountId produced by an InfoPath Contact Selector

    Won't be able to use Created By/etc, there are a number of fields in the form with user names (i.e. Assignee, etc). Something we're toying around with is using the jQuery SPService to update Views dynamically based on the current user on the page http://spservices.codeplex.com/wikipage?title=Views&referringTitle=%24%28%29.SPServices It's a hassle, but it looks like it should work, wish there was an easier way about it.

    Also, I tried out that idea I mentioned in the OP about having the field already exist in the site columns gallery as a Person or Group object prior to activating the forms. The field does get tricked into being a Person or Group object, but nothing seems to get stored into the field when submitting a form (conversion error I'm guessing). So no good on that.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.