Hello,
I am trying to build a combobox with an If Statement, however it doesn't work as I have data coming from 2 different data source.
Both formula of the if statement works separately but not together.
is there a solution?
If(ToggleShipFrom.Value=false, Filter('REPORTING.V_IBP_POSSIBLE_LOC_REPUNIT', DESTPLANTDESCR= CBShipto.Selected.Result).SOURCEPLANTDESCR, RenameColumns('REPORTING.M_IBP_LOCATION'.LOCDESCR , "LOCDESCR", "Result"))
Solved! Go to Solution.
I found the solution, the 2 column needed to have the same name
Thanks @Anonymous for your help !
Tried this out. You can use collections to solve this. So, if you have a toggle, you can add to OnChange:
ClearCollect(List1, Source1.item)
ClearCollect(List2, Source2.item)
Add any filtering you need, so you get the items you require.
Then the combobox items would be:
If(ToggleShipFrom.Value=false; List1; List2)
Remember to add those collections also in Screen1 (or whatever screenname you have) -> OnVisible, so you'll have the collections ready when the app is started. The collections are updated with the toggle.
Hello @Anonymous ,
Thank you for the idea... unfortunatelly it doesn't work. The combobox is still blank. Any other idea ?
Thanks in advance,
Capucine
It works for me. Maybe I explained it badly. Here's a more descriptive tutorial:
Code for my toggle. As you can see, i'm getting data from two different sources. The point is to get one column of data from that source and make it a collection. In my case, i'm getting a column called "Title" from one source and a column called "KP" from another source.
Code for my combobox. I simply check the value of the toggle, and fetch the collection (List1 and List2) based on the value.
End result, if the toggle is "true".
End result if the toggle is "false".
Hope this helps!
Hello,
thanks for the detailed explication... however it is still not working for me please find bellow the screen shot :
Thanks for the pictures! If you go to File -> Collections, what data is showing in List1 and ListFull?
Nevermind, I think I know where the problem is. The problem is with this code:
Filter('REPORTING.V_IBP_POSSIBLE_LOC_REPUNIT', DESTPLANTDESCR= CBShipto.Selected.Result)
Power Apps is expecting a text, but that is not a text value. You can get around this by setting the selected result as a variable. So, select CBshipto combobox (or dropdown) and change the code in OnChange to this:
Set(ShipTo; CBShipTo.Selected.Value)
Then change the previous code to:
Filter('REPORTING.V_IBP_POSSIBLE_LOC_REPUNIT', DESTPLANTDESCR= ShipTo)
I think that will fix this.
Here are the 2 screen shot
This is not fixing the problem... CBShipto.Selected.Result is a text
And If use only this formula it is working for my Combobox
I found the solution, the 2 column needed to have the same name
Thanks @Anonymous for your help !
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |