cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amyharkus86
Resolver II
Resolver II

Select All checkbox

I have a gallery that lists all the items, this can be filtered by date created with to and from range and then exported to CSV, At the moment the user need to tick each checkbox, but I'd like to add a select all button that would only select those visible from the filtered option. 

 

Gallery Items 

 

Sort(Filter(
     colDWB,
     (Due_x0020_Date >= DatePicker1.SelectedDate) && (Due_x0020_Date <= DatePicker2.SelectedDate)), ID, Descending)

 

 

Refresh button - OnSelect 

 

ClearCollect(colDWB, AddColumns('Dont Walk By', "IsChosen", false))

 

 

Export to CSV button 

 

Set(varDrop, DropColumns(Filter(colDWB, IsChosen), "Author", "Assigned_x0020_to", "Category", "Editor", "Manager", "Priority", "joim" , "{Thumbnail}", "Related_x0020_Issues"));
Set(varFormattedJSON, JSON(varDrop, JSONFormat.IndentFour)); 


ExportToCSV_Email.Run(varFormattedJSON)

 

 

OnCheck on checkbox 

 

Patch(colDWB, ThisItem, {IsChosen: true})

 

OnUncheck of checkbox 

 

Patch(colDWB, ThisItem, {IsChosen: false})

 

 

This works great each item that ticked can then be exported, but id like to add a select all option

 

amyharkus86_0-1625133151891.png

 

Not sure who to do this without removing my already working and required export function. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JamesYumnam
Resolver III
Resolver III

@amyharkus86 if i understand correctly, your gallery has the result after applying certain filters.

and with this result, you have got two requirements:

  1. to be able to export selected items from the gallery
  2. to be able to export all the items in the gallery (because those are filtered already).

Now, your requirement 1 is fulfilled as you are able to select few items and then export them.

for requirement 2, you just need to export all the items in the gallery in the following manner.

In Export to CSV button, use an If condition.

  • If the count of selected items in the gallery > 0,
  • then export selected items only from the gallery.
  • else, export all the items in the gallery.

Please let me know if got your requirements correctly, then i may be able to help you out.

View solution in original post

5 REPLIES 5
JamesYumnam
Resolver III
Resolver III

if you want to export all the filtered results currently displayed in the gallery, why to add extra effort to use a select all checkbox? I think, in that case, you can just add the code in your Export to CSV button along with a condition to export the items displayed in the gallery (you already have code for export). 

@JamesYumnam The filter is used to date range a month or whatever but not always is every item in that filtered needed to be exported, for example if the status is closed we wouldn't need to export the item, althogh in my example above all items would be, within the filtered month there could be 20 items but only 10 of those would need to be exported. 

 

In regards to adding a filter on the export button 

 

Set(varDrop, DropColumns(Filter(colDWB, IsChosen), "Author", "Assigned_x0020_to", "Category", "Editor", "Manager", "Priority", "joim" , "{Thumbnail}", "Related_x0020_Issues"));
Set(varFormattedJSON, JSON(varDrop, JSONFormat.IndentFour)); 


ExportToCSV_Email.Run(varFormattedJSON)

 

sorry that was suppose to say , could i do this? 

if i just wanted to export the filtered month?

 

Set(varDrop, DropColumns(Filter(colDWB, Due_x0020_Date >= DatePicker1_1.SelectedDate && Due_x0020_Date <= DatePicker2_1.SelectedDate ), "Author", "Assigned_x0020_to", "Category", "Editor", "Manager", "Priority", "joim" , "{Thumbnail}", "Related_x0020_Issues"));
Set(varFormattedJSON, JSON(varDrop, JSONFormat.IndentFour)); 


ExportToCSV_Email.Run(varFormattedJSON)

 

JamesYumnam
Resolver III
Resolver III

@amyharkus86 if i understand correctly, your gallery has the result after applying certain filters.

and with this result, you have got two requirements:

  1. to be able to export selected items from the gallery
  2. to be able to export all the items in the gallery (because those are filtered already).

Now, your requirement 1 is fulfilled as you are able to select few items and then export them.

for requirement 2, you just need to export all the items in the gallery in the following manner.

In Export to CSV button, use an If condition.

  • If the count of selected items in the gallery > 0,
  • then export selected items only from the gallery.
  • else, export all the items in the gallery.

Please let me know if got your requirements correctly, then i may be able to help you out.

View solution in original post

@JamesYumnam thankyou for your reply, after discussing further with the department this is for its been decided that they wish to export all items in a view, so i have done as you suggested and export based on the filter, no need for tick boxes 

 

Set(varDrop, DropColumns(Filter(colDWB, Due_x0020_Date >= DatePicker1_1.SelectedDate && Due_x0020_Date <= DatePicker2_1.SelectedDate ), "Author", "Assigned_x0020_to", "Category", "Editor", "Manager", "Priority", "joim" , "{Thumbnail}", "Related_x0020_Issues"));
Set(varFormattedJSON, JSON(varDrop, JSONFormat.IndentFour)); 


ExportToCSV_Email.Run(varFormattedJSON)

 

 

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,728)