Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Suggested answer

Using a Field as a parameter

Posted on by 15

Good Morning, 

I am creating some views using advanced find, and am wondering if it is possible to use a related or otherwise field as a parameter 

so for example:

createdon <= entity[modified_date]

Thank you

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Using a Field as a parameter

    Hi SovereignAutos,

    No, you can only compare columns within a single table as this doc says:

    Use column comparison in queries (Microsoft Dataverse) - Power Apps | Microsoft Docs

    As a workaround, you could create a calculated field to do this. The following is my test:

    1. I create a Person entity which has a N:1 relationship with Contact entity:

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_13_2D00_52_2D00_45.png

    2. Create a calculated field(Date and Time) and set it's value to Contact Modified date(You first have to select the Lookup field and then type a period like <LookupFieldName>.<RelatedFieldName>):

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_13_2D00_59_2D00_05.png

    3. Create a view with Advanced Find(We could not select the column to compare in Advanced Find):

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_14_2D00_00_2D00_43.png

    4. Because we could not select the column to compare in Advanced Find, we need to use View Design and FetchXML Builder in Xrm ToolBox.

    5. Open the view with View Design and edit it's fetchxml:

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_14_2D00_04_2D00_53.png

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_14_2D00_05_2D00_31.png

    Fetchxml should be like this:

      
        
        
        
        
        
        
        
          
        
      
    

    6. You could execute it to preview, then save and publish it.

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_14_2D00_09_2D00_45.png

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_14_2D00_10_2D00_49.png

    Result:

    Snipaste_5F00_2022_2D00_03_2D00_10_5F00_14_2D00_12_2D00_13.png

    Reference:

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/column-comparison

    We can now do column comparison with Fetch/Web API! | It Ain't Boring (itaintboring.com)

  • Suggested answer
    onurizgi Profile Picture
    onurizgi 360 on at
    RE: Using a Field as a parameter

    Hi,

    If the entity you want to compare is related to the entity you are searching for, you can do this search. For example, suppose the Customer entity is related to the Person entity 1:N. You can compare the Created Date on the Customer entity to the Modified Date on the Contact entity.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,336 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans