The delete function uses a system variable,, ie "BrowseGallery1.Selected", that is set on leaving the gallery for the detail section.
A problem has occurred that occasionally incorrectly deletes the wrong record.
To be specific, if the user wants to delete a recently created record, the system variable is sometimes set to the last old record.
This is probably because I was to generous with navigation, which may be corrected by restricting it, but I would prefer a more durable solution.
So, I'd like to know if there's a way to set "BrowseGallery1.Selected" to the recently created record since my attempt at fixing the problem by replacing it with my own code generates an error:
RemoveIf([@Tabell1]; Regnr = regnr_DC1.DataField );; If (IsEmpty(Errors( [@Tabell1]; Filter( Fordon; Regnr = regnr_DC1.DataField) )
Thanks for reading,
Johan Arve
DetailScreen1.IconDelete1 in
Power Apps
Solved! Go to Solution.
Hi @JohanArve ,
Does regnr contain a unique value for each record ? If so, set a Variable on the OnSelect of BrowseGalllery1
Set(varReg,ThisItem.regnr)
then the Item of your Form should be
LookUp(
TableName,
regnr = varReg
)
then your delete code
RemoveIf(
TableName,
regnr = varReg
)
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
I have tested inserting the screen name and form name in front of the datacard name, but the error persists. There's a hint suggesting that there's a problem with data types. The data source are Excel and Access files, but both should be strings since a "regnr" had both numbers and letters.
Hi @JohanArve ,
Does regnr contain a unique value for each record ? If so, set a Variable on the OnSelect of BrowseGalllery1
Set(varReg,ThisItem.regnr)
then the Item of your Form should be
LookUp(
TableName,
regnr = varReg
)
then your delete code
RemoveIf(
TableName,
regnr = varReg
)
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
Thank you. You rule.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
189 | |
54 | |
41 | |
37 | |
32 |
User | Count |
---|---|
252 | |
75 | |
71 | |
69 | |
68 |