microsoft / microsoft/Power-Fx
Warn if using RemoveIf in a Gallery with a connection that is not the same as the Gallery Data source
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.4k
- Forks
- 358
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 3
Description
This bit me pretty hard today:
I have a gallery that is displaying values from a SQL View
This is the data source:
SortByColumns(Filter('[dbo].[SiteHistoryView]', SiteNumber = SelectedDispatch.SiteNumber), "CreatedDate", Descending)
I've added a delete Icon with this OnSelect() to delete the record form the source:
RemoveIf('SiteHistory', HistoryID = ThisItem.HistoryID);
Here is the results of me clicking the delete icon starting from the bottom:

This is due to only the top one or two records in the Gallery having an id that is in the top 500 of the SiteHistory, and since it is not delegatable, only the rows in the view that correspond to the top 500 rows in the table are deletable. Doing a RemoveIf in a Gallery that uses a different source than the Gallery will often not do what the user want/expects and a warning should probably be created about delgation .
Session Details:
Timestamp: 2022-11-16T14:58:17.761Z
Session ID: 36f09a10-6520-11ed-82ff-7ba4fba895c0
Tenant ID: d843cb99-8386-4d4c-a924-e7147b4e184a
Object ID: dc40ed33-a73f-4ffe-9c10-bf35b3cd21e8
Build name: 0.0.20221101.1-2210.5-prod
Organization ID: c71b1ef6-d833-48ce-b6aa-423bcdcab3b8
Unique name: orge3a8686f
Instance url: https://orgfa3b91e3.crm.dynamics.com/
Environment ID: Default-d843cb99-8386-4d4c-a924-e7147b4e184a
Cluster environment: Prod
Cluster category: Prod
Cluster geo name: US
Cluster URI suffix: us-il105.gateway.prod.island
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Gallery formula over [dbo].[SiteHistoryView] and the RemoveIf formula against SiteHistory. Trace how delegation is analyzed for RemoveIf when its data source differs from the Gallery source; done means the problematic usage produces a clear warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100