knowledgecenter-breadcrum

Knowledge Center

02 Feb, 2024

How to use operators like, not-like, on, in, not-in, on-or-before, and on-or-after in FetchXml using WebAPI

Posted on 02 Feb, 2024 by Shekhar Jain, Posted in Dynamics 365 Web Api Dynamics 365

Blogs

In this blog, we will learn how to use operators like, not-like, on, in, not-in, on-or-before, and on-or-after in Web API.

What is “like” operator?

The like operator in FetchXML is used for performing partial string matching in a query. It allows you to filter records based on a specific pattern within a string attribute.

You can customize the placement of the % symbols to create different pattern matching scenarios. For instance:

  • %John would match names ending with "John."
  • John% would match names starting with "John."
  • %John% would match names containing "John" anywhere within them.

Output:

What is “not-like” operator?

In this, the character string does not match the specified pattern.

Output:

What is “on” operator?

It retrieves all the records for a specified date.

Output:

What is “in” operator?

The in operator is used to filter records based on a set of predefined values for a specific attribute. It allows you to retrieve records that have a certain attribute value matching any of the values specified in the set. The in operator is useful when you want to filter records based on multiple possible values for a single attribute.

Output:

What is “not-in” operator?

The given value is not matched to a value in a subquery or a list.

Output:

What is “on-or-before” operator?

The on-or-before operator is used in FetchXML queries to filter records based on a date attribute that falls on or before a specified date value. This operator is commonly used to retrieve records with dates that are earlier than or equal to a given date.

Output:

What is “on-or-after” operator?

The on-or-after operator is used in FetchXML queries to filter records based on a date attribute that falls on or after a specified date value. This operator is commonly used to retrieve records with dates that are after or equal to a given date.

Output:

 

Comment

This is a Required Field

Loading

Recent Updates

Business Central thumbnail image
Blogs
06 Jan, 2025

What is Dynamics 365 Business Central? A Comprehensive Beginner's Guide

Dynamics 365 Business Central is a unified business management system offered by Microsoft. It helps businesses automate and manage various…

READ MORE
Thumbnail D365 for Marketing
Blogs
16 Dec, 2024

10 Reasons Why You Need Dynamics 365 for Marketing

This blog discusses the top 10 reasons to choose Dynamics 365 for Marketing to improve your business's marketing efforts.  …

READ MORE
Thumbnail_top 10 benefits of
Blogs
02 Dec, 2024

Top 10 Benefits of Microsoft Dynamics 365

This blog lists the advantages of Microsoft Dynamics 365, focusing on how it can improve your business operations.    …

READ MORE