Hi,
I have a gallery that functions as an editable table: Gallery3.
It is populated by collection: colTxnReviewFiltered
The user can make edits some some of the fields, and on clicking a button I can successfully patch the updates to the underlying SP list.
I have a field for each record in the gallery, GL_lookup. This doesn't exist in the collection but it serves to flag if there is a mismatch between a value in the collection and a 'suggested' value that is derived from another list. This field gets filled red or green if there is a match or not.
If(
IsBlank(GL_lookup.Text), RGBA(300,0,0,1),
GL_lookup.Text = GL_CLASS_dd.Selected.Value, RGBA(0, 200, 0, 1),
RGBA(300,0,0,1)
)
I would like to be able to either filter or sort the gallery by the colour of the GL_lookup field. The column at the end is the field

I can't seem to be able to filter directly on that field (which makes sense as you it doesn't exist in the collection). I was thinking I could patch a 1 or 0 to a field in the collection and then sort on that but I am having a nightmare of a time working out how to patch values to the collection to begin with.
I thought I could use a variation of the patch/forall function I having working for other updates in this gallery:
But I get an error that the datasource is invalid if I use the collection (colTxnFilterREview) in lieu of 'CC Txns - template' which is a SP list.
Patch(
'CC Txns - template',
ForAll(Gallery3.AllItems,
{
ID: ID,
//APPROVALSTATUS: Figure out issue with approval status
//Figure out how to update approver
DESC: GL_DESC_dd.Selected.Value,
CLASS: GL_CLASS_dd.Selected.Value,
BRANCH: Dropdown18.Selected.Title,
DEPT: Dropdown18_1.Selected.Title,
HAS_GST: If(GST.Text <> Blank(), true, false),
GST: If(GST.Text <> Blank(), Value(GST.Text), Blank())
}
)
)
Any help would be greatly appreciated.
Cheers
K