Hi powerapps community, I am struggling with an application and need your help.
In my app I have for example de following table
Dessert | Ingredient | Bar Code |
Cookies | Flavor | 1234 |
Cookies | Chocolate | 12345 |
Cookies | Milk | 123456 |
Cookies | Eggs | 12 |
Cake | Flavor | 1234 |
Cake | Vanilla | 123 |
Cake | Milk | 123456 |
Cake | Eggs | 12 |
I have 2 dropdowns and 1 textinput so i need the following:
first dropdown select the dessert (done)
second dropdown select the ingredient filterd by the dessert dropdown selection (done)
and this is what i´m struggling in the textinput I type the barcode but I need to create a formula to change de fill color depending on the typed text (if the barcode exist in the selected dessert and ingredient fill green if not fill red) i made the following code:
If(Dropdown1.Selected.Result=LookUp(Table1;'Bar Code '=TextInput1.Text;Dessert) && Dropdown2.Selected.Result=LookUp(Table1;'Bar Code '=TextInput1.Text;'Ingredient');RGBA(54; 176; 75; 1);RGBA(255; 0; 0; 1))
So if I type in the textinput 1234 selecting cookies and flavor y does change green (1234 is the bar code for the flavor and the flavor is used in the cookies) but if I select cake and flavor it changes to red (1234 is the bar code for the flavor and the flavor is used in the cake but as the lookup formula shows only the first value the formula is not able to see that this condition that i need to evaluate also is true)
can you please help me find the correct formula for this example?
Solved! Go to Solution.
Hi @Anonymous :
Please try this code:
If(TextInput1.Text in Filter(Table1;Dessert=Dropdown1.SelectedText.Value && Ingredient=Dropdown2.SelectedText.Value).'Bar Code';RGBA(54; 176; 75; 1);RGBA(255;0;0;1))
Best Regards,
Bof
Try
If(Filter(Datasource;Dessert=Dropdown1.Selected.Result && Dropdown2.Selected.Result=Ingredient &&'Bar Code '= TextInput1.Text);RGBA(54; 176; 75; 1);RGBA(255; 0; 0; 1))
------------
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.
It doesnt work it send a error message that if have no non valid arguments, and it says that the datasource is not valid because it was expectede a boolean data
Hi @Anonymous :
Please try this code:
If(TextInput1.Text in Filter(Table1;Dessert=Dropdown1.SelectedText.Value && Ingredient=Dropdown2.SelectedText.Value).'Bar Code';RGBA(54; 176; 75; 1);RGBA(255;0;0;1))
Best Regards,
Bof
Thanks a lot for the help!
User | Count |
---|---|
260 | |
109 | |
92 | |
56 | |
41 |