
I have a PowerApp form connecting to a SharePoint List.
The list contains a field (type Toggle) called 'Document Approved' status.
I already have a filter based on the 'Created by' and 'Status'.
However when I try to change the code and add a filter for this Toggle field it fails and hides all gallery entries.
When 'Created by' and or 'Status' contains data, it works successfully and pops up only the entries not checked by 'Document Approved'.
See the green marked part in the code underneath:
//If('TeamInc procedure requests'.'Documents approved'= false,
If(
And(
IsBlank(inpCreatedBy.Selected.Result),
IsBlank(inpStatus.Selected.Result)
),
Sort(
'TeamInc procedure requests',
'Document name',
Ascending
),
If(
And(
!IsBlank(inpCreatedBy.Selected.Result),
!IsBlank(inpStatus.Selected.Result)
),
Filter(
'TeamInc procedure requests',
And(
'Created By'.DisplayName = inpCreatedBy.Selected.Result,
Status.Value = inpStatus.Selected.Result,
'Documents approved'= false
)
),
If(
!IsBlank(inpCreatedBy.Selected.Result),
Filter(
'TeamInc procedure requests',
'Created By'.DisplayName = inpCreatedBy.Selected.Result,
'Documents approved'= false
),
Filter(
'TeamInc procedure requests',
Status.Value = inpStatus.Selected.Result,
'Documents approved'= false
)
)
)
)
//)
Please be so kind and inform me how I can solve this issue
Kind regards,
Jan
netherlands
You cannot filter properly on a Yes/No column for false values in PowerApps with the =false statement.
Please consider changing your Formula to the following:
Sort(
Filter('TeamInc procedure requests',
(IsBlank(inpCreatedBy.Selected.Result) || 'Created By'.DisplayName = inpCreatedBy.Selected.Result) &&
(IsBlank(inpStatus.Selected.Result) || Status.Value = inpStatus.Selected.Result) &&
!'Documents approved'
),
'Document name'
)
The above is equivalent to your prior formula but has been simplified and includes the logic for the Document approved filter.
I hope this is helpful for you.