web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

What conditionoperator when checking if an attribute in contained in any element of an array?

(1) ShareShare
ReportReport
Posted on by 2

I am currently trying to check if any elements in sentenceArray contain value1/2/3/4, but the code below does exact /equal/ matches. Is there a change to the conditionexpression I could do to check if elements in sentenceArray contains value1? 

Code:

string[] sentenceArray= { sentence1, sentence2, sentence3, sentence4 };

ConditionExpression sentence1Search = new ConditionExpression(/value1/, ConditionOperator.In, sentenceArray);

ConditionExpression sentence2Search = new ConditionExpression(/value2/, ConditionOperator.In, sentenceArray);

ConditionExpression sentence3Search = new ConditionExpression(/value3/, ConditionOperator.In, sentenceArray);

ConditionExpression sentence4Search = new ConditionExpression(/value4/, ConditionOperator.In, sentenceArray);

FilterExpression sentenceSearchFilter = new FilterExpression(LogicalOperator.Or); 
KPSearchFilter.Conditions.Add(sentence1Search);  
KPSearchFilter.Conditions.Add(sentence2Search);
KPSearchFilter.Conditions.Add(sentence3Search);
KPSearchFilter.Conditions.Add(sentence4Search);

QueryExpression sentenceQuery = new QueryExpression(/sentencevalues/);
KPQuery.Criteria.AddFilter(sentenceSearchFilter);

 

Any help is greatly appreciated!

Thanks in advance!

Tharun

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans