0

In InfoPath 2013 form, I am able to match for a single value in the people picker with current logged in user using formula rule-

AccountId = userName()

But in case if we have multiple users in AccountId then how to match if any of these users matches userName()

EDIT 1

If I set the People Picker to accept multiple names and then use

contains(AccountId, username())

It matches the username's substring also. Meaning if I enter user but current user is user_1, the condition is true.

2
  • Have you checked result of multiple users? I mean how it will display multiple users with (;) or (,)? Apr 25, 2016 at 5:24
  • In People Picker it shows with (;).
    – soccer7
    Apr 25, 2016 at 5:27

2 Answers 2

1

For a multiple selection enabled People Picker field, you should be able to match current user using the contains function in the formula shown below

contains(AccountId, userName())

In this case if the Account ID contains the current user's login name, the formula would return true and false otherwise.

1
  • This fails if I have username like - user and user_1. Now if it is user then condition is also true for user_1
    – soccer7
    Apr 25, 2016 at 5:02
0

Concat username with ;. and check it with contains condition. It must be give false if verifying user with including user_1 also.

6
  • There is another problem now. After specifying multiple users in People Picker, if we look at the value of its AccountId you'll see only first user.
    – soccer7
    Apr 25, 2016 at 5:42
  • Have you checked account id display as repeating section in data source? like having any groups on account id? Apr 25, 2016 at 5:47
  • No, AccountId is simple field of PeoplePicker
    – soccer7
    Apr 25, 2016 at 5:49
  • Please try to get data in other control (Dropdown, Multi selection, textarea) except textbox control. Apr 25, 2016 at 5:54
  • Does InfoPath Rules allow us to do that?
    – soccer7
    Apr 25, 2016 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.