cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mattw112IG
Impactful Individual
Impactful Individual

How to change the choices presented to a user from a SP choice field

Hi,

I have a choice field in SharePoint like

 

Apple

Orange

Pear

 

In my Power app, if User().FullName = "Bob Jones"...

 

Then I would like the chocies presented to only be

 

Apple

Orange

 

...

 

How would I accomplish this without hard coding the choices in the app?

 

Right now the Items are

Choices([@Sponsor_1].Role_x0020_to_x0020_Sponsor_x002)
 
Thanks,
Terry

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
eka24
Super User III
Super User III

If(User().FullName = "Bob Jones",

Filter(Choices([@Sponsor_1].Role_x0020_to_x0020_Sponsor_x002),Value = "Apple" Or "Orange"),
Choices([@Sponsor_1].Role_x0020_to_x0020_Sponsor_x002))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Mattw112IG
Impactful Individual
Impactful Individual

So eka24, this didn't work, it only shows the first option (before the OR's) in the dropdown (for example above, "Apple"... not apple and orange).  In my choice I have about a dozen choices and I tried to get them all to show except the one I didn't want, but always just shows the first one before the OR.

 

So since I only needed (right now) to exclude one option, I just used the code you sent and instead did a

 

Value <> "Pear"

 

This works and shows me everything except that option, which will work for me today.

 

In the future though if I need to exclude more than one option would be good to know how to get your method to work.

 

Thanks,

Terry

View solution in original post

2 REPLIES 2
eka24
Super User III
Super User III

If(User().FullName = "Bob Jones",

Filter(Choices([@Sponsor_1].Role_x0020_to_x0020_Sponsor_x002),Value = "Apple" Or "Orange"),
Choices([@Sponsor_1].Role_x0020_to_x0020_Sponsor_x002))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

Mattw112IG
Impactful Individual
Impactful Individual

So eka24, this didn't work, it only shows the first option (before the OR's) in the dropdown (for example above, "Apple"... not apple and orange).  In my choice I have about a dozen choices and I tried to get them all to show except the one I didn't want, but always just shows the first one before the OR.

 

So since I only needed (right now) to exclude one option, I just used the code you sent and instead did a

 

Value <> "Pear"

 

This works and shows me everything except that option, which will work for me today.

 

In the future though if I need to exclude more than one option would be good to know how to get your method to work.

 

Thanks,

Terry

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (51,857)