GetUserProfileByName - AccountID being used in filter giving unexpected results - InfoPath Dev
in

InfoPath Dev

GetUserProfileByName - AccountID being used in filter giving unexpected results

Last post 02-01-2018 07:52 AM by Hilary Stoupa. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-31-2018 09:14 AM

    GetUserProfileByName - AccountID being used in filter giving unexpected results

    Hi I have built a time sheet system in Sharepoint 2013 and I am getting some unexpected results for some users (not all).

    Basically I have one list which is a basic sharepoint list which lists Project names and has a field "Assigned to" which is a people picker which can accept multiple people onto one project.

    Secondly I have a timesheet entry list where individuals assign time against their projects. This list uses an infopath (2013) form and has a drop down which uses a data connection to the first list. This drop down is being filtered by so that the current user will only see the projects that have been assigned to them.

    In the infopath form I am using rules on form load to set the query field of the GetUserProfileByName AccountName to the AccountID of the creator of the form. So that I get hold of the person currently logged in. Then in the dropdown field for the projects, I am filtering on where the AccountID in the Project list lookup is equal to the value of the Account field for the person logged on.

    The odd behaviour I am experiencing is that this works for some staff but not all. Some people seem to be returning their projects and the projects of their managers!

    Does anyone have any ideas at all? Thanks

  • 02-01-2018 07:38 AM In reply to

    Re: GetUserProfileByName - AccountID being used in filter giving unexpected results

     Sorted this one myself.

    The GetUserProfileByName service returns ALL the properties from AD for that user and this includes their manager. So what was happening was that my filter was using both AccountId's of the user AND their manager.

    Resolved by setting a text field to just be the accountId of the user in form load and then filtering the drop down on that.

  • 02-01-2018 07:52 AM In reply to

    Re: GetUserProfileByName - AccountID being used in filter giving unexpected results

    Great, glad you have it working! One tip for others reading this - putting the data source on the form (in this case, the data fields for GetUserProfileByName) can help debug. :)
    Hilary Stoupa

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.