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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering the appointm...
Power Apps
Answered

Filtering the appointment records based on account name

(0) ShareShare
ReportReport
Posted on by 8

Hi All

 

I am trying to build a power-app which show all the Dynamics CRM 'Appointments' which needs further filtering by the 'Account/Company' name

 

I got the Dynamics CRM's connector and entities into my data set. I also added Appointment and Account Screen .

 

The appointment screen contains the fields I need from the Appointment entity. It also has the 'Account Name' (converted from the Regarding field)

 

I am now trying to filter the 'AppointmentScreenGallery' based on the value in the Search field. Lets say 'Adventure Works' is added in the search field (please see attached screenshots)

 

I am struggling to filter the gallery (items) so that it shows only appointments of 'Adventure Works'. I have my query at the moment along the lines of

Search(Appointments,LookUp(Accounts,CompanyField=SearchCompanyName.Text,'Account Name'),"_regardingobjectid_value")
 
Please could you kindly point me to the right direction?
 
Thanks in advance

 

 

 

 

AppointmentScreen.PNG
QueryIssue.PNG
Adventureworks search.PNG
Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Ayyappa ,

    Based on the formula that you mentioned, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

    2.JPG

    Set the Items property of the Gallery to following:

    Filter(
     [@Appointments],
     StartsWith(
     AsType(Regarding, Accounts).'Account Name',
     TextSearchBox1.Text
     )
    )

    Note: The Regarding column is actually a polymorphic lookup column in D365 CRM Entity or CDS Entity. Please check the following article for more details:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-references#understand-regarding-relationships

     

    AsType function

     

    Please consider take a try with above solution, then check if the issue is solved. If the issue still exists, please consider add CDS Entity connection as data source in your app instead of the D365 CRM Entity connection.

     

    Best regards,

  • ayyappa1 Profile Picture
    8 on at

    Hi @v-xida-msft 

     

    Thanks for the solution and links.  The logic did not work for the Dynamics CRM Data Sources Entities.. but when connected to Common Data Service Data sources entities it worked like a charm. 

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard