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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

use attribute in condition tag of Fetch XML

(0) ShareShare
ReportReport
Posted on by 687

Can we use attribute in condition tag of Fetch XML query? Let say, I want to find out the opportunities where name and description are same.

<fetch mapping="logical" output-format="xml-platform" version="1.0" returntotalrecordcount="true" distinct="true" >
    <entity name="opportunity" >
        <attribute name="opportunityid" />
        <attribute name="name" />
        <attribute name="description" />
        <filter type="and" >
            <condition attribute="name" operator="eq" value="description" />
        </filter>
    </entity>
</fetch>

Regards,

Hardik Chauhan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Hardik ,

    This is a limitation of FetchXML , you can not compare two fields  value using FetchXML.

  • Verified answer
    MS CRM DYNAMICS Profile Picture
    592 on at

    I believe ,There is no way to compare two fields using FetchXML. Alternative you can  do as below.

    Create a hidden field on your entity which holds the comparison result(Compare two field values using Javascript On Save of the form and update the result in this hidden field) and then you can make use of this hidden field on your FetchXML query for reporting purposes.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans