cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bhuvita
Level: Powered On

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@AnqiChen @ScottDurow 

 

I tried to use the approach Scott suggest and it works correctly for alphabets and All keyword but for # it doesn't seems to work. Below is my code.

 

Where char is alphabet letter.

 

  var condition = null;
            if (char == "#") {
                let alphabets: string[]  = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                condition = {
                    attributeName: "name",
                    conditionOperator: 8, //
                    value: alphabets,
                    entityAliasName: "opportunity",
                };
            }
            else {
                char = char + "%";
                condition = {
                    attributeName: "name",
                    conditionOperator: 6, //
                    value: char,
                    entityAliasName: "opportunity",
                };
            }
            const conditionArray = [];
            conditionArray.push(condition);
            this.contextObj.parameters.sampleDataSet.filtering.setFilter({
                // @ts-ignore
                conditions: conditionArray,
                filterOperator: 1, // Or
            });
            this.contextObj.parameters.sampleDataSet.refresh();

 

What am I doing wrong here ?

 

I also tried to use the keyword displayIndex:true and indeed it display the bar at the right side so as of now we can't use it.

ScottDurow
Level 8

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

I think the issue is that you are using the 'in' operator on the list of numbers - but actually you need to still use the like:

let alphabets: string[]  = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                condition = {
                    attributeName: "name",
                    conditionOperator: 8, //
                    value: alphabets,
                    entityAliasName: "opportunity",
                };

 

This will only match opportunities that have a name EXACTLY equal to 1,2,3...

I would use the same approach you are using for the like - but add a list of conditions that are grouped in a filter OR group:

 

{
        "filterOperator": 1, // OR
	"conditions": [
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "0%"
		},
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "1%"
		},
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "2%"
		},
		{
			"attributeName": "fullname",
			"conditionOperator": 6, // LIKE
			"value": "3%"
		}
		...
	]
}

 

Bhuvita
Level: Powered On

Re: Showing View Selector and Command bar on Subgrid Custom Compnonent

@ScottDurow 

Yes I do tried with IN condition and array but this doesn't work .I was in assumption that it will take array directly.

 

let alphabets: string[]  = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                condition = {
                    attributeName: "name",
                    conditionOperator: 6, //
                    value: alphabets,
                    entityAliasName: "opportunity",
                };

 

But after looping through list of condition not just passing the array it works.

 let numbers: string[] = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
                for (var num of numbers) {
                    num = num + "%";
                    condition = {
                        attributeName: "name",
                        conditionOperator: 6, // Equal or Under
                        value: num,
                        entityAliasName: "opportunity",
                    };
                    conditionArray.push(condition);
                }

 

Thanks for your response.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,879)