web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I change the ch...
Power Apps
Answered

How do I change the choices for one field, based on the selection of another field?

(0) ShareShare
ReportReport
Posted on by 21

I have a form with these 'choice' fields,

 

Select Organization: (Organization 1, Organization 2)

 

Select Location: (Location 1, Location 2, Location 3, Location 4, Location 5)

 

If a user selects "Organization 1" They should only be able to select (Location 1, Location 2)

And if they select "Organization 2" They should only be able to select (Location 3, Location 4, Location 5)

----

 

Using this code I've almost got it to work, but will only show 1 Location, not all 3.

 

In my Location card 'Items'

 

If(DataCardValue30.Selected.Value = "Organization 2",LookUp(Choices([@'List'].Location),Value="Location 1" && "Location 2" && "Location 3"), Parent.Default)

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @noahh97 

    Are these actual Choice columns in your datasource, or are they somehow related?

    Are you trying to make this relationship in your app itself as hard-coded conditions or something else?

  • noahh97 Profile Picture
    21 on at

    Yes they are choice columns in the Sharepoint list.

    and yes trying to make these hard coded conditions, so that users cannot select an Organization with the wrong values for Location

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @noahh97 

    Since you're hard-coding, there is no real reason to rely on the Choice column values as they exist in the list because you have no relationship between them, and you're putting it in by hand.

     

    So...with that in mind, change your Select Organization dropdown Items property to:

    Table(
     {Org: "Organization 1", Locations: ["Location 1", "Location 2"]}
     {Org: "Organization 2", Locations: ["Location 3", "Location 4", "Location 5"]}
    )

     

    And then change your Location dropdown Items property to: 

    yourOrganizationDropdownName.Selected.Locations

     

    This will give you what you are looing for.

  • Guicord101 Profile Picture
    151 on at

    Hi!
    I have the same situation as the post in my app and your code worked except for 1 point:
    After the user selects the option the data from the "organization" dropdown is not sent to sharepoint. Any idea what it could be?

  • maxbett Profile Picture
    3 on at

    The same thing has happened with my project. It hasn't returned the first datapoint needed. Did you find a fix?

  • Guicord101 Profile Picture
    151 on at

    Hi! I used the cascading data
    https://www.youtube.com/watch?v=Qzpjq008cBY

    it worked for me

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard