cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sharaths463
Frequent Visitor

PCF control on subgrid

I've created a PCF control on subgrid, we're using office ui fabric react and react nuget packages. We're trying to filter the subgrid using below code. but the subgrid displays all record and filter is not applying on subgrid.

enum condOperators {
Equal,
}
var condition = {
attributeName: "msdyn_account",
conditionOperator: condOperators.Equal,
value: "{3c11d08a-4751-ea11-a813-000d3a7f1cdc}",
entityAliasName: "msdyn_payment"
};

 

context.parameters.sampleDataSet.filtering.setFilter({
conditions: [condition],
filterOperator: 0
});
context.parameters.sampleDataSet.refresh();

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @sharaths463 ,

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, and the Filtering formula works well.

 

The screenshot of my TypeScript code as below:

9.JPG

On your side, you should modify your formula as below:

var condition = {
                attributeName: "msdyn_account",
                conditionOperator: 0,     // Specify 0 here rather than Enum value you defined here
                value: "3c11d08a-4751-ea11-a813-000d3a7f1cdc",   // Remove '{' and '}' symbol which wrapped the GUID value
                entityAliasName: "msdyn_payment"
};
var conditionArray = [];
conditionArray.push(condition);
context.parameters.sampleDataSet.filtering.setFilter({
        conditions: conditionArray ,
        filterOperator: 0
});
context.parameters.sampleDataSet.refresh();

More details about supported values for conditionOperator in PowerApps Component Framework, please refer to following article:

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/conditionexpressi...

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/How-to-use-filter-and-search-in-PCF-for-R...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @sharaths463 ,

Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, and the Filtering formula works well.

 

The screenshot of my TypeScript code as below:

9.JPG

On your side, you should modify your formula as below:

var condition = {
                attributeName: "msdyn_account",
                conditionOperator: 0,     // Specify 0 here rather than Enum value you defined here
                value: "3c11d08a-4751-ea11-a813-000d3a7f1cdc",   // Remove '{' and '}' symbol which wrapped the GUID value
                entityAliasName: "msdyn_payment"
};
var conditionArray = [];
conditionArray.push(condition);
context.parameters.sampleDataSet.filtering.setFilter({
        conditions: conditionArray ,
        filterOperator: 0
});
context.parameters.sampleDataSet.refresh();

More details about supported values for conditionOperator in PowerApps Component Framework, please refer to following article:

https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/conditionexpressi...

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Power-Apps-Pro-Dev-ISV/How-to-use-filter-and-search-in-PCF-for-R...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks for the response, there is a heirarchy on account Entity, I'm trying to achieve above or equal in the query for account, but this doesn't yield me any results, below is the code that i'm using. Could you please help me on this.

 

context.parameters.sampleDataSet.filtering.setFilter({
            conditions: [{
                attributeName: "msdyn_account",
                conditionOperator: 78// Above or equal
                value: context.page.entityId // Remove '{' and '}' symbol which wrapped the GUID value
            }],
            filterOperator: 0,
        });

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,072)