Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter Operation with "in" operator overwrites .Id property on manipulated object #2637

Open
cchannon opened this issue Sep 12, 2024 · 2 comments

Comments

@cchannon
Copy link

I have just found that the Filter() function will drop and replace the .Id property of all rows in the Table with a sequentially-assigned whole number (1, 2, 3, etc.) if the Filter function includes an In operator.

image

This behavior may be specific to the context where I have implemented my code: I am writing the PFX in a Custom Page in a Dataverse Model Driven App, using Dataverse as my datasource (hence, my Ids are all GUIDs to begin).

@anderson-joyle
Copy link
Contributor

I was not able to replicate this scenario. Can you share more details?

@cchannon
Copy link
Author

cchannon commented Sep 24, 2024

Sure, so first, the datasource is a custom dataverse table [ 'Tags' ] and the "Valid For" column is a Multiselect Optionset from Dataverse. In PowerFx, the value of this column presents as a table, which is why I need to use the "{value} in {multiselect optionset}" operator to check for the presence of an expected value [ 'Valid For (Tags)'.Opportunity ].

My actual use case is another nested filter deep, but it isn't relevant to the issue I am observing. I only bring that up to explain that even three or four nested filters deep, the .Id property normally persists as a GUID: it is only once I apply a Filter using the "{value} in {multiselect optionset}" operation that the .Id property is replaced with a sequentially assigned whole number (1, 2, 3, etc.).

Now, ordinarily this is not much of an issue (the .Id property is quite optional which is probably why this has not been reported before) but I am then using this content inside a custom code component where it is important for me to be able to initiate WebAPI operations on these rows, and without a GUID that becomes a headache. There is an easy enough workaround (just include the id attribute as a column in the Items input) but I would venture that workaround shouldn't be necessary, as the .Id property should be persistent no matter the filter operation.

If it helps for quick repro, I can add you as a guest user in my Tenant so you can directly observe it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants