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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple conditions fo...
Power Apps
Answered

Multiple conditions for autofill dropdown

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi guys,

 

I am trying to do the following, I have an app where users need to select a product they want to order. Based on the product they need to give a yes or no option on two different fields. I want to get an automatic status update based on what the user does.

 

So for example, user picks product A and ticks yes, status becomes: No Actions.

 

This is the table I want to use

ProductA CompleteB CompleteStatus
AYesNoNo Actions
ANoNoUpload A
BNoYesNo Actions
BNoNoUpload B
A & BYesNoUpload B
A & BNoYesUpload A
A & BNoNoUpload A & B
A & BYesYesNo Actions

 

What would be the best and easiest way too implement this? 

 

Thanks for the help!

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

    @Anonymous 

    I have a feeling your example might be a bit too abstract for a definitive solution, but in your case I did this:

    1) Created a ListBox with the following Items property ["A", "B"]

    2) Created a Gallery with an Items property of ListBox1.SelectedItems

    3) Put a CheckBox in the Gallery and set the Text property to: ThisItem.Value & " Complete"

    4) Put a Label on the screen and set the Text property to:

    With({lclUps:Filter(Split(Concat(Gallery1.AllItems, If(!Checkbox1.Value, Value & ",")), ","), !IsBlank(Result))},
     If(CountRows(lclUps)=0, "No Actions",
     "Upload " & Concat(lclUps, Result & If(!(Result=Last(lclUps).Result), " & ")))
    )

     

    This produces the exact results based on your description.

     

    I hope this is helpful for you.

  • Verified answer
    Duhorothy Profile Picture
    51 on at

    Using three input controls and a collection, you can solve your issue. When the value of the ComboBox changes, perform a clear collect to keep track of which products are selected. I am collecting Product and Upload. The Upload column of this collection will be used to build the string in the status Label.

     

    ComboBox (Products)
    Items: ["Product A","Product B"]

    OnChange: ClearCollect(Status, ForAll(Products.SelectedItems, {Product: Value, Upload: If(Value="Product A","A","B")}));Reset(OptionA);Reset(OptionB)

     

    Toggle1 (OptionA)
    OnCheck: Remove(Status, LookUp(Status,Product="Product A"))

    OnUncheck: Collect(Status, {Product: "Product A", Upload:"A"})

     

    Toggle2 (OptionB)

    OnCheck: Remove(Status, LookUp(Status,Product="Product A"))

    OnUncheck: Collect(Status, {Product: "Product A", Upload:"A"})

     

    Label (Status) - I chose not to use a dropdown here. If that is a hard requirement you would need to define the choices, then select the appropriate choice using the same logic below

    Text: If(CountRows(Status)=0, "No Actions", If(CountRows(Status)=2, "Upload "& Concat(Status, Upload, " & "), "Upload "&First(Status).Upload))

     

    For fun, I displayed the toggles for Option A Complete and Option B Complete conditionally based on the Product Selection.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your reply, I will try it out later today! 

  • Duhorothy Profile Picture
    51 on at

    Let me know if this works for you!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Same here...

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 839

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 412

Last 30 days Overall leaderboard