Can I add restrictions to who can add a person in the person/group picker? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Can I add restrictions to who can add a person in the person/group picker?

Last post 06-03-2022 03:17 PM by alo123. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 06-03-2022 08:23 AM

    Can I add restrictions to who can add a person in the person/group picker?

    I am completely new to InfoPath and I've been asked to make some modifications to an existing form. The form currently has a person/group picker and I want to add another right below it. However, I want the second person/group picker to picked only by the person that was firstly chosen in the first person/group picker. Suppose the person in the first person/group picker is Apple, then only Apple can select who the second person in the second person/group picker is going to be. Of course, its not always going to be same person in the first person/group picker but is it possible to have the first person in the first person/group picker to be the only one that can edit the second person/group picker?
  • 06-03-2022 08:51 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    Testing in the browser, I found that disabling the people picker only half-works. I couldn't click the button to use the address book but was still able to type in the field and enter data. So I took the approach of hiding it, and showing a calculated value with the display name of the second person. I've attached a sample, right click the link in the header and save this file locally. Right click the saved file and select "Design" to open in InfoPath designer. From there you can preview - but you may need to publish this form for it to work correctly if you sign in with a different account to SharePoint than your machine. Hopefully I've added enough info in the sample to be helpful.
    Hilary Stoupa

  • 06-03-2022 09:09 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    Thanks for replying. First off your idea of hiding the box makes sense. I'm a little confused as to how the Current User and Account ID text box are to be filled out? Would that be through some outside flow, manually entered, or some other alternative?
  • 06-03-2022 09:18 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    So I just put those on the form for your information - in the formatting on the second people picker, I'm hiding it if the account id from the first people picker doesn't match the result of the InfoPath userName() function - check that formatting on both the second people picker and the calculated value below it.
    Hilary Stoupa

  • 06-03-2022 10:41 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    I understand that the userName() function returns the name of the person filling out the form, but can this function or is there some other function that can return the name of the first person/group picker?
  • 06-03-2022 10:45 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    The account id field of the people picker has that value :)
    Hilary Stoupa

  • 06-03-2022 10:51 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    Okay, I guess I'm confused. How does the Account ID field return or grab the name of the first person/group picker? I don't see any rule or function tied to this field.
  • 06-03-2022 10:58 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    If you look at the fields bound to the person / group picker, one of them is the account id? The account id field is part of the person / group picker?
    Hilary Stoupa

  • 06-03-2022 11:02 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    Oh okay, since I'm new to this I didn't know this.
  • 06-03-2022 11:56 AM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    Understandable, and people picker fields are kind of weird - it isn't immediately obvious that they are a repeating group with fields in them :)
    Hilary Stoupa

  • 06-03-2022 03:17 PM In reply to

    Re: Can I add restrictions to who can add a person in the person/group picker?

    I am looking to see if I can do the same on my own but I can't seem to get the rule to work properly. I am try to set the rule as AccountId not equal to userName() but AccountId is not an option. What am I doing wrong?
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.