Hi @Mgodby ,
Do you want to filter gallery items based on five fields that you listed and if you not enter any data in that field, you will not use that field as filter condition?
Could you tell me:
1)'Seat ID'field data type,'Aduit Number'field data type,'Build Event' field data type,'Audit Status' field data type
2)the Items of two combo boxes: SearchBuildEventComboBox, SearchLocationComboBox
3)the relationship between these two combo boxes, I notice that they both filter based on the same field 'Build Event'
Just based on the formula that you listed, I made a little change, try this:
Filter(AuditHeaderVariable,
If(IsBlank(SearchSeatId.Text),true,'Seat ID'=SearchSeatId.Text),
If(IsBlank(SearchAuditId.Text),true,'Audit Number'=SearchAuditId.Text),
If(IsEmpty(SearchBuildEventComboBox.SelectedItems),true,'Build Event'.Name=SearchBuildEventComboBox.Selected.Name),
If(IsEmpty(SearchLocationComboBox.SelectedItems),true,'Build Event'.Name=SearchLocationComboBox.Selected.Name),
If(IncompletdAuditsInput.Value,Text('Audit Status')<>"Completed")
)
You just need to use If statements to justify whether you enter data, If you not enter any data, you could set the condition as "true".
So just need to use formula like this:
Filter(table,
If(IsBlank(...),true,condition1),
If(IsBlank(...),true,condition2),
....)
What's more, I think the 'Audit Status' field should be choice type. If so, you should try this:
Filter(AuditHeaderVariable,
If(IsBlank(SearchSeatId.Text),true,'Seat ID'=SearchSeatId.Text),
If(IsBlank(SearchAuditId.Text),true,'Audit Number'=SearchAuditId.Text),
If(IsEmpty(SearchBuildEventComboBox.SelectedItems),true,'Build Event'.Name=SearchBuildEventComboBox.Selected.Name),
If(IsEmpty(SearchLocationComboBox.SelectedItems),true,'Build Event'.Name=SearchLocationComboBox.Selected.Name),
If(IncompletdAuditsInput.Value,'Audit Status'.Value<>"Completed")
)
Best regards,