Hello everyone,
I am working on my file explorer, which is supposed to access files and folders from two document libraries.
Users can access the SharePoint document libraries "DL_Permission" or "Dokumente2" via the DropDown control "SelectionDirectory" The Sharepoint entries are loaded into a gallery.
In the Item property of the gallery, I am using the following code:
If(
!IsBlank(TextInput1_1.Text),
Search(
Filter(
Switch(
SelectionDirectory.Selected.Value, // Here
"Dokumente2", Dokumente2, // Here
"DL_Permission", DL_Permission // Here
),
'Folder path' = varFolderPathSelectionFiles &&
(
IsBlank(FilterValue.Text) ||
(varFilterItem_00_05 = "'File name with extension'" && Text(FilterValue.Text) in 'File name with extension') ||
(varFilterItem_00_05 = "Modified" && Text(FilterValue.Text) in Text(Modified)) ||
(varFilterItem_00_05 = "Modifiedby" && Text(FilterValue.Text) in 'Modified By'.DisplayName) ||
(varFilterItem_00_05 = "Created" && Text(FilterValue.Text) in Text(Created)) ||
(varFilterItem_00_05 = "Createdby" && Text(FilterValue.Text) in 'Created By'.DisplayName)
)
),
TextInput1_1.Text,
'File name with extension'
),
varFilterSortDirection_00_05 = 1,
Sort(
Filter(
Switch(
SelectionDirectory.Selected.Value, // Here
"Dokumente2", Dokumente2, // Here
"DL_Permission", DL_Permission // Here
),
'Folder path' = varFolderPathSelectionFiles &&
(
IsBlank(FilterValue.Text) ||
(varFilterItem_00_05 = "'File name with extension'" && Text(FilterValue.Text) in 'File name with extension') ||
(varFilterItem_00_05 = "Modified" && Text(FilterValue.Text) in Text(Modified)) ||
(varFilterItem_00_05 = "Modifiedby" && Text(FilterValue.Text) in 'Modified By'.DisplayName) ||
(varFilterItem_00_05 = "Created" && Text(FilterValue.Text) in Text(Created)) ||
(varFilterItem_00_05 = "Createdby" && Text(FilterValue.Text) in 'Created By'.DisplayName)
)
),
Switch(
varFilterItem_00_05,
"'File name with extension'", 'File name with extension',
"Modified", Modified,
"Modifiedby", 'Modified By'.DisplayName,
"Created", Created,
"Createdby", 'Created By'.DisplayName
),
SortOrder.Ascending
),
varFilterSortDirection_00_05 = 2,
Sort(
Filter(
Switch(
SelectionDirectory.Selected.Value, // Here
"Dokumente2", Dokumente2, // Here
"DL_Permission", DL_Permission // Here
),
'Folder path' = varFolderPathSelectionFiles &&
(
IsBlank(FilterValue.Text) ||
(varFilterItem_00_05 = "'File name with extension'" && Text(FilterValue.Text) in 'File name with extension') ||
(varFilterItem_00_05 = "Modified" && Text(FilterValue.Text) in Text(Modified)) ||
(varFilterItem_00_05 = "Modifiedby" && Text(FilterValue.Text) in 'Modified By'.DisplayName) ||
(varFilterItem_00_05 = "Created" && Text(FilterValue.Text) in Text(Created)) ||
(varFilterItem_00_05 = "Createdby" && Text(FilterValue.Text) in 'Created By'.DisplayName)
)
),
Switch(
varFilterItem_00_05,
"'File name with extension'", 'File name with extension',
"Modified", Modified,
"Modifiedby", 'Modified By'.DisplayName,
"Created", Created,
"Createdby", 'Created By'.DisplayName
),
SortOrder.Descending
),
Filter(
Switch(
SelectionDirectory.Selected.Value, // Here
"Dokumente2", Dokumente2, // Here
"DL_Permission", DL_Permission // Here
),
'Folder path' = varFolderPathSelectionFiles &&
(
IsBlank(FilterValue.Text) ||
(varFilterItem_00_05 = "'File name with extension'" && Text(FilterValue.Text) in 'File name with extension') ||
(varFilterItem_00_05 = "Modified" && Text(FilterValue.Text) in Text(Modified)) ||
(varFilterItem_00_05 = "Modifiedby" && Text(FilterValue.Text) in 'Modified By'.DisplayName) ||
(varFilterItem_00_05 = "Created" && Text(FilterValue.Text) in Text(Created)) ||
(varFilterItem_00_05 = "Createdby" && Text(FilterValue.Text) in 'Created By'.DisplayName)
)
)
)
Switch
function in Power Apps expects each condition (key-value pair) to be separated by a single comma.Switch
logic with an If
function. Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.