Hi @AGroegelich
The reasons for this is that is because the Items property of the form will be Gallery1.Selected and after writing a new record the gallery will still show the last selected record.
For the suggestion below, I will call your Gallery Gallery1, your Edit/New Form Form1, your data set DataSet1 and the New/Edit screen Screen2
The are two items that may allow you do do something
There is a Form property called LastSubmit (so EditForm1.LastSubmit.ID returns the ID of the last item submitted by Form1)
The gallery has a property called TemplateFill which is the Fill colour of an item in the gallery. This is normally set to something like (ignore the colours below and set your own)
If(ThisItem.IsSelected,Grey,White)
So if you set a variable (I will call it vNew) on the Save button of Form1
If(
Form1.Mode = FormMode.New,
Set(vNew,true),
Set(vNew,false)
);
SubmitForm(Form1);
Back();
Refresh(DataSet1)
Then on the TemplateFill of Gallery1
If(
vNew,
If(
ThisItem.ID = Form1.LastSubmit.ID,
Grey,
White
),
If(
ThisItem.IsSelected,
Grey,
White
)
)
The last thing I would do is reset the variable when another record is selected
Set(vNew,false);
Navigate(Screen2,ScreenTransition.None)
Please have a try at this and let me know how you go.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.