Retrieval of Name into People-Picker Field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Retrieval of Name into People-Picker Field

Last post 11-06-2014 05:59 AM by klink. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 11-05-2014 11:35 AM

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Retrieval of Name into People-Picker Field

    Not sure if I'm on the right forum for this, but since I'm using qRules in my form, I thought I'd start here!  =)

    I have a form that contains fields for a follow-up task.  One of the fields is "Assigned To," which is a People-Picker field.  I have:

    1. Used "SubmitToSharePointList" to save the name using concat("-1;#", AccountId).
    2. Used Data Connection to retrieve record.  I set all three person fields:
      • DisplayName
      • AccountId
      • AccountType

    However, upon retrieval (started on click of button), all task fields appear EXCEPT the Assigned To field.  However, if I click the button again, it appears.

    What am I missing?  ARGH!

  • 11-05-2014 11:42 AM In reply to

    Re: Retrieval of Name into People-Picker Field

    I want to guess something... is this in the browser?

    Hilary Stoupa

  • 11-05-2014 11:48 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Retrieval of Name into People-Picker Field

    Why, yes.  Yes it is!  =)  Sorry, should have mentioned that before!

    Also, this is a Claim-based site, in case that makes a difference.

  • 11-05-2014 12:00 PM In reply to

    Re: Retrieval of Name into People-Picker Field

    I have seen some really fun-tastic behavior with people pickers in the browser when we set them via rules / code. I think it has to do with post back behavior, I'm not sure.

    May I suggest a work around? Just display the display name as a calculated value. Add a button the user can push if they wish to edit it and when they click the button, display the people picker so they can pick a new people. :)

    You'll probably need to add a field to determine whether you should show or hide it - but this is what I've done in similar situations and it seems to have been acceptable to users (they don't really think anything of a "pick new" button to use the people picker).

    Hilary Stoupa

  • 11-05-2014 12:28 PM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Retrieval of Name into People-Picker Field

    Thanks for the quick reply!  I've actually got "some" of this accomplished in other parts of the form.  The users wanted a drop-down list when picking company representatives (because they were always the same, and it's easier to pick from a drop down than to actually use the people picker...or so they say  =/ ).  So I have them filling in the first and last name and add it to a "Rep" list.  I will just add a "Person" column to the list. 

    So, another question.  For the dropdown, would I will use the AccountId as the dropdown Value, or the ID? 

    • If I use the AccountID and they pick a name, I could just use the concatenate with the AccountID like I already do.
    • But if it is a new name, I want to use SubmitToSharePointList to submit the name to the list, re-retrieve the list, and then display with the newly added name as the current name.  But since I don't have the Value set to the ID, how would I do it?

    So, better to use the ID for the value, and then everytime they pick one, get the name AccountId from the record with that ID and concatenate?

    Or, maybe there's a better way??? 

    By the way...for the short time that I've been using Qdabra, everytime I hit a snag I seem to find some video or blog that you have done that answers it!  You are the QUEEN!  =)

  • 11-05-2014 12:40 PM In reply to

    Re: Retrieval of Name into People-Picker Field

    The point of concatenating with "-1" is because we may not know the SharePoint ID number for the account. For example, I could give you access to my site, but you won't have an ID # until you've actually visited it. So the "-1" means "go look it up you lazy server" (I'm paraphrasing here) - does that make sense? If I am setting a person or group in SharePoint, I always submit -1;#AccountId.

    Hilary Stoupa

  • 11-05-2014 01:02 PM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Retrieval of Name into People-Picker Field

    I get that.  I think I may be making this too complicated.  Let me try again.  If I want a drop down list of user names so I can pick one and then update an Assigned To "People" field on an SP Task list, I need:

    • a "Rep" list (a list of a select group of users, which can't be prefilled because the users don't want to be bothered with figuring out who should be in said list,,,insert *skeptical face* here...).  This list would need to have a:
      • Title (which I would fill with the DisplayName from a people-picker)
      • Rep (which would be a "People" column and would be filled with the cancat with "-1" on a new entry)

    When I retrieve the "Rep" list for the Assigned To dropdown, can I use the Rep column for the dropdown Display Name?  Or do I need to use the Title?  Or would (could) I use the DisplayName from the Rep column?  And what do I use for the dropdown Value?

    When I retrieve the "SP Task" list, what do I use for the Assigned To dropdown field?  I don't want to have to save the ID from the "Rep" list in the "SP Task" list.

    Is this clear as mud???

  • 11-05-2014 04:00 PM In reply to

    Re: Retrieval of Name into People-Picker Field

    I guess if I was creating a user list for use in a form, I'd just have a column for the display name and a column for the account ID - not a column with a person or group data type (Rep in your suggestion above). Although I guess with using a people picker, you know the account is valid?

    If you do use a people picker in your "Rep" list, you wouldn't have to have a title - the people picker in the list, when you query the list, should return the display name and the account ID. I'd use the account id for the value. Then you'd have the account ID in the Rep list, in the field you bind the drop down to in the form (the account id from the task list) and just don't put the field you are actually mapping to the task list on the form.

    Wow - sorry - I'm concerned I'm being unclear. Let me know if I'm not making sense and I'll try again. :) 

    Hilary Stoupa

  • 11-06-2014 05:59 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Retrieval of Name into People-Picker Field

    This makes perfect sense!  I am going to make the Title the display name, and then add a field for the Account ID. 

    I'm not going to be making this change just yet, but I'll try to remember to report back with the results!

    Again, THANKS for all of your help!

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