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
Product | A Complete | B Complete | Status |
A | Yes | No | No Actions |
A | No | No | Upload A |
B | No | Yes | No Actions |
B | No | No | Upload B |
A & B | Yes | No | Upload B |
A & B | No | Yes | Upload A |
A & B | No | No | Upload A & B |
A & B | Yes | Yes | No Actions |
What would be the best and easiest way too implement this?
Thanks for the help!
Solved! Go to Solution.
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.
@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.
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.
Thank you for your reply, I will try it out later today!
Let me know if this works for you!
@Anonymous
Same here...
User | Count |
---|---|
252 | |
102 | |
94 | |
50 | |
39 |