Hey I'm developing a food ordering app at the moment and I have a feature called "Pool" that lists all the pre-ordered menus that have been added by a user who unfortunately can't be in the office that day so someone else can can take over the menu.
Info: I have the German syntax running.
I have a Gallery control that gets data from a sharepoint list
Sort(Filter(
Pool_1;
Today() <= 'Angebot Für'
);AddedToPoolDate;Ascending)
and for each item in the Gallery control there is also a button with an OnSelect.
UpdateContext({BoxVisible3: true});;
UpdateContext({BoxVisible72: true});;
Refresh(Pool_1);;
If(
!IsEmpty(
Filter(
Pool_1;
ID = ThisItem.ID
)
);
Patch(
Pool_1;
LookUp(
Pool_1;
ID = ThisItem.ID
);
{TookOverBy: User().Email};
{TookOverDate: currentime}
)
;"");;
Refresh(Pool_1);;
If(
!IsEmpty(
Filter(
Pool_1;
ID = ThisItem.ID && TookOverBy = User().Email
)
);
Patch(
Bestellungen;
Defaults(Bestellungen);
{
Besteller: User().FullName;
eMail: User().Email;
Besteller_x0020_ehemalig: ThisItem.Besteller;
Men_x00fc_ID: ThisItem.MenüID;
Title: ThisItem.'Menü Name';
VoucherUsed: ThisItem.VoucherUsed;
VoucherUsedCode: ThisItem.VoucherUsedCode;
Beschreibung: ThisItem.Beschreibung;
Datum: ThisItem.'Bestellt am';
Anmerkung: ThisItem.Anmerkung;
TookOverBy: User().Email;
TookOverDate: currentime;
AddedToPoolBy: ThisItem.AddedToPoolBy;
AddedToPoolDate: ThisItem.AddedToPoolDate;
Extra1: ThisItem.Extra1;
Extra2: ThisItem.Extra2;
Extra3: ThisItem.Extra3;
Preis: ThisItem.Preis;
Bestellbar_x0020_Von: ThisItem.'Bestellbar Von';
Bestellbar_x0020_Bis: ThisItem.'Bestellbar Bis';
Angebot_x0020_F_x00fc_r: ThisItem.'Angebot Für';
Vegetarisch: ThisItem.Vegetarisch;
AllergenA: ThisItem.AllergenA;
AllergenB: ThisItem.AllergenB;
AllergenC: ThisItem.AllergenC;
AllergenD: ThisItem.AllergenD;
AllergenE: ThisItem.AllergenE;
AllergenF: ThisItem.AllergenF;
AllergenG: ThisItem.AllergenG;
AllergenH: ThisItem.AllergenH;
AllergenL: ThisItem.AllergenL;
AllergenM: ThisItem.AllergenM;
AllergenN: ThisItem.AllergenN;
AllergenO: ThisItem.AllergenO;
AllergenP: ThisItem.AllergenP;
AllergenR: ThisItem.AllergenR
}
);;
Remove(
Pool_1;
ThisItem
);;
UpdateContext({BoxVisible72: false});;
UpdateContext({BoxVisible70: true});
UpdateContext({BoxVisible71: true})
);;
UpdateContext({BoxVisible69: true});;
UpdateContext({BoxVisible72: false});;Refresh(Pool_1)
and in the background I have a timer running at a repeating one second interval to get live data
Refresh(Pool_1);;Set(currentime;Now());;ClearCollect(
ColPoolCount;Filter(
Pool_1;
Today() <= 'Angebot Für'
)
)
The current problem is that when two users on this Gallery control take over two different menus at the same time, when fetching the data and patching, the This.Item function gets confused and the information doesn't come from the Selected Item It instead gets the information from the above or below element, depending on which element is selected first in that split second of taking over and refreshing the data.
I hope someone can help me with this issue.
Hi @Ermin ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
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.
Visit my blog Practical Power Apps
User | Count |
---|---|
256 | |
108 | |
97 | |
51 | |
39 |