Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Unanswered

FetchXML Filter not working

(0) ShareShare
ReportReport
Posted on by 10

I have this XML code that I sued to create a Custom Filter on a List

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
 <entity name="cr7d0_newtable">
 <link-entity name="contact" from="contactid" to="cr7d0_contributor_1" alias="contributor1">
 <filter type="and">
 <condition attribute="contactid" operator="eq" value="{{ user.contactid }}" />
 </filter>
 </link-entity>
 </entity>
</fetch>


The main purpose of this is to filter the list based on the Contact Logged 
The list has up to 5 Columns called Contributor_1 to Contributor_5 these columns are type Lookup to the Contacts table

So when a user submit a record they can add contributors to the record and when it is done, the user can see the records created by them but also the records where they are listed as contributors. 
but when I apply this filter I got no records filtered just an error

IT_User_0-1701312493961.png

 

Categories:
  • Fubar Profile Picture
    7,955 Super User 2025 Season 1 on at
    Re: FetchXML Filter not working

    The Created By can only be a System User.  Your Portal Users are Contacts (not system users). 

    For the view criteria you can set it equal to any existing Contact record (or create a dummy one, in the old days there they used to install a default one named Portal User) the Portal backend will swap that contact in the criteria to the current portal user when it does the query of the data.

  • IT_User Profile Picture
    10 on at
    Re: FetchXML Filter not working

    but for the Contact record I don't get the same filter options as if were using Created By
    there is no Contributor_1 (Contact) Equals Current User

  • Fubar Profile Picture
    7,955 Super User 2025 Season 1 on at
    Re: FetchXML Filter not working

    Firstly, you cannot put Liquid inside the fetchXML Filter (it will just render as text).

    Using the Filters I doubt you will be able to do what you are wanting.

     

    What you could do is create 2 views (e.g. My Contributions and All Contributions) add them to the List (and as already pointed out on another post group the criteria as an OR for the different fields you and set them to a Contact record - the system will replace that contact record with the logged in portal user).  The user will then be able to select either view.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >