Announcements
To troubleshoot why your variable (var) is blank when trying to export gallery data to an Excel or CSV file, let's ensure all steps are correctly followed. Matthew Devaney's method is robust but requires precise setup.
var
Ensure the Gallery Data Source is Valid Ensure your gallery (Gallery1) is correctly bound to the SharePoint list and is displaying the desired data.
Gallery1
Set the OnSelect Property of the Button Update the button's OnSelect property with the correct logic to create the CSV file.
OnSelect
Example formula:
ClearCollect( colExportData, ForAll( Gallery1.AllItems, { Column1: ThisRecord.Title, Column2: ThisRecord.Description, Column3: Text(ThisRecord.Created, "[$-en-US]yyyy-mm-dd") } ) ); Set( varCSVData, Concat( colExportData, Column1 & "," & Column2 & "," & Column3 & Char(10) ) ); Download(varCSVData, "GalleryData.csv", "text/csv")
Column1
Column2
Check varCSVData Variable After setting varCSVData in the OnSelect formula, verify its content:
varCSVData
Text
Validate colExportData Collection If varCSVData is blank, the issue might be with the colExportData collection:
colExportData
Items
Debug Common Issues
ThisRecord.ColumnName
.Value
.DisplayName
Test the Download Function After confirming varCSVData contains valid data, ensure the Download function works:
Download
Download("Test,Data", "Test.csv", "text/csv")
Browser Settings Ensure your browser allows file downloads. Some browsers block downloads in apps due to security settings.
ThisRecord.ColumnName.Value
ThisRecord.ColumnName.Email
Set( varJSONMail, JSON( ShowColumns( YourGallery.AllItems, "OutputColumn1", "OutputColumn2", "OutputColumn3" ), JSONFormat.IndentFour ) )
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 236 Super User 2026 Season 2
WarrenBelz 188 Most Valuable Professional
Mohsin Ali 130