Dear Power Apps Community,
Following code is used to filter a Gallery:
Sort(
Search(
AddColumns(
Filter(
JOBIO_DATA;
JOB_STATUS.Value = "Not Started";
IsBlank(cboLocation.SelectedItems.Value) || IsEmpty(cboLocation.SelectedItems.Value) || JOB_LOCATION.Value = cboLocation.Selected.Value;
IsBlank(cboWho.SelectedItems.Value) || IsEmpty(cboWho.SelectedItems.Value) || JOB_WHO.Value = cboWho.Selected.Value;
IsBlank(cboPrio.SelectedItems.Value) || IsEmpty(cboPrio.SelectedItems.Value) || JOB_PRIORITY.Value = cboPrio.Selected.Value;
IsBlank(cboParts.SelectedItems.Value) || IsEmpty(cboParts.SelectedItems.Value) || JOB_PARTS_PRESENT.Value = cboParts.Selected.Value
);
"IDcopy";
Text('Id (ID)')
);
txtSearchBox.Text;
"JOB_SHORT_DESCRIPTION";
"IDcopy"
);
JOB_SHORT_DESCRIPTION;
Switch(
varShortDescriptionStart;
0;
SortOrder.Ascending;
1;
SortOrder.Descending;
2;
SortOrder.PROBLEM
)
);
JOB_DATUM_AANGEMAAKT;
Switch(
varDateAddedStart;
0;
SortOrder.Ascending;
1;
SortOrder.Descending;
2;
SortOrder.PROBLEM
)
);
JOB_PRIORITY.Value;
SortOrder.Ascending
)
The issue: I'm using two switch functions that change the SortOrder to Ascending/Descending depending on the value of a variable (set by a button). I would like to third, neutral, option where the Sort function is not used.
For example:
Switch(
varShortDescriptionStart;
0;
SortOrder.Ascending;
1;
SortOrder.Descending;
2;
Neutral position, specific column is not being sorted for anything
)
The reason I want this neutral position is because the functions are interlocking. For example once one of the two variables sorts the gallery on date added, the other alfabetically, once I sort on date added the alfabetical one has no influence anymore.
Any ideas?
Kind regards,
Sébastien