Hi,
I have a dropdown with information of a sharepoint list, de column of information is "Choice", so I conect the data to de dropdown with this formula:
Choices('Visitas para ventas'.'Canal Comercial')
So I have a gallery and a graphic that I need to see the information if I chose any option of the dropdown, I conect that with this formula:
Gallery
If(Dropdown1.Selected.Value = None ;'Visitas para ventas';SortByColumns(Filter('Visitas para ventas';'Canal Comercial'.Value = Dropdown1.Selected.Value);"{FilenameWithExtension}";Ascending))
Graphic
AddColumns(Filter('Visitas para ventas';'Canal Comercial'.Value = Dropdown1.Selected.Value);"Canal C";('Visitas realizadas'/'Visitas programadas'))
The problem is that I want to see all the records in the gallery and graphic if i don´t select nothing in the dropdown, Is there any code that I can use to do this.
Solved! Go to Solution.
Hi @Anonymous ,
I just tested with the same scenario. If your Choice column does not include a null value, then the default selected value will never be blank for this dropdown control. So all the above formulas won't work.
If you want to start with a blank item in the dropdown, you can set its Items property to a collection where the first element is blank. Set below formula in the OnStart property of your app:
ClearCollect(C1,{Value:""});;Collect(C1,Choices('Visitas para ventas'.'Canal Comercial'))
Then set below formula in the Items property of your dropdown control.
C1.Value
For Items property of your Gallery, set to:
If(IsBlank(Dropdown1.Selected.Value);'Visitas para ventas';SortByColumns(Filter('Visitas para ventas';'Canal Comercial'.Value = Dropdown1.Selected.Value);"{FilenameWithExtension}";Ascending)))
This works for me. Please go ahead and have a try.
Regards,
Mona
Have you considered using the isBlank() function.
Items = If (isBlank(Dropdown1.Selected.Value), 'Visitas para ventas', "ELSE apply the filter")
Have you try using IsBlank()?
If(IsBlank(Dropdown1.Selected.Value) ;'Visitas para ventas';SortByColumns(Filter('Visitas para ventas';'Canal Comercial'.Value = Dropdown1.Selected.Value);"{FilenameWithExtension}";Ascending))
Hi @Anonymous ,
I just tested with the same scenario. If your Choice column does not include a null value, then the default selected value will never be blank for this dropdown control. So all the above formulas won't work.
If you want to start with a blank item in the dropdown, you can set its Items property to a collection where the first element is blank. Set below formula in the OnStart property of your app:
ClearCollect(C1,{Value:""});;Collect(C1,Choices('Visitas para ventas'.'Canal Comercial'))
Then set below formula in the Items property of your dropdown control.
C1.Value
For Items property of your Gallery, set to:
If(IsBlank(Dropdown1.Selected.Value);'Visitas para ventas';SortByColumns(Filter('Visitas para ventas';'Canal Comercial'.Value = Dropdown1.Selected.Value);"{FilenameWithExtension}";Ascending)))
This works for me. Please go ahead and have a try.
Regards,
Mona
yes Mona, I remember that in one of my projects, I added a "-" to my choices and handled it that way. If we want to use the isBlank() function then we need to follow your suggestion and use a collection.
Edwin
Hey @Anonymous
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
195 | |
46 | |
45 | |
42 | |
36 |
User | Count |
---|---|
269 | |
82 | |
81 | |
75 | |
69 |