Trying to create a default sort (newest to oldest by date) in this Gallery Screen View function selected is 'Items'...any ideas?
It's not wanting to let me add a Sort(SPList, ActivityDate, Ascending, Descending prior to the filter so they will all be filtered). Not sure if I need to add this on each level? Or perhaps I'm trying to get the items wrong.
//overall filter allowing users to specify a date range that will reduce the activities returned
Filter(
//if statement to separate admin and user results
If(IsAdmin And !varLoggedInAsUser,
//if user is admin and activity type is "Choose one...", filter by the results entered into the search box
If(
IsBlank(ComboBox1.SearchText) And Dropdown1.SelectedText.Value = "Choose one...",
colSalesActivity,
//user is searched and activity type is "Choose one..."
If(
!IsBlank(ComboBox1.SearchText) And Dropdown1.SelectedText.Value = "Choose one...",
Filter(colSalesActivity, ComboBox1.SearchText in AddedBy.DisplayName),
//user is searched and activity type is NOT "Choose one..."
If(
!IsBlank(ComboBox1.SearchText) And Dropdown1.SelectedText.Value <> "Choose one...",
Filter(colSalesActivity, ComboBox1.SearchText in AddedBy.DisplayName And ActivityType.Value = Dropdown1.SelectedText.Value),
//user is NOT searched and activity type is NOT "Choose one..."
If(
IsBlank(ComboBox1.SearchText) And Dropdown1.SelectedText.Value <> "Choose one...",
Filter(colSalesActivity, ComboBox1.SearchText in AddedBy.DisplayName And ActivityType.Value = Dropdown1.SelectedText.Value))))),
//if user is not admin, they can only see their own records
//check to see if user filters by activity type
If(
//if they don't filter by activity type, the value will be 'Choose one...'
Dropdown1.SelectedText.Value = "Choose one...",
Filter(colSalesActivity, User().Email in AddedBy.Claims),
//if they do select an activity type, filter records by that activity type
Filter(colSalesActivity, ActivityType.Value = Dropdown1.SelectedText.Value And User().Email in AddedBy.Claims))
),
//this line finishes the overall filter that allows date range to be specified
ActivityDate >= DatePicker1.SelectedDate And ActivityDate <= DatePicker1_1.SelectedDate)