Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Suggested answer

LookUp using GUID comparison not returning values, despite match

(1) ShareShare
ReportReport
Posted on by 58

Hi all,

 

I’ve been working with a canvas app embedded inside a model-driven app. I’m trying to retrieve a record from my Dataverse table 'MDA Approvals' using the GUID of the current record from ModelDrivenFormIntegration.

 

This code works correctly and returns the expected record, but throws a delegation warning:

 

Set(
varApprovalRecord,
LookUp(
'MDA Approvals',
Text(Approvals) = First(ModelDrivenFormIntegration.Data).ItemId
)
)
 
 

To avoid the delegation warning, I tried switching to a pure GUID comparison:

 

Set(
varApprovalRecord,
LookUp(
'MDA Approvals',
Approvals = GUID(First(ModelDrivenFormIntegration.Data).ItemId)
)
)
 
 

But strangely, this version does not return any record — even though the values should match.

To verify this, I tested in a label:

 
 
If(varApprovalRecord.Approvals = GUID(First(ModelDrivenFormIntegration.Data).ItemId), true, false)
 
 

This returns true, which confirms that both IDs match.

 

So my question is:

 

  • Why does the LookUp() using GUID(...) not return a record?

  • Is there a reliable way to write this that avoids delegation warnings and actually returns results?





  •  
 

Thanks in advance for any insights!
GP

Categories:
  • stampcoin Profile Picture
    3,126 on at
    LookUp using GUID comparison not returning values, despite match
    try this one.
    With(
        { MyID: First(ModelDrivenFormIntegration.Data).ItemId },
        Set(
            varApprovalRecord,
            LookUp(
                'MDA Approvals',
                Text(Approvals) = MyID
            )
        )
    )
  • grandepaci Profile Picture
    58 on at
    LookUp using GUID comparison not returning values, despite match
    Hi @Aishish Mishra

    I tried your suggestion and put your code inside the OnVisible property of my Screen.

    When loading the GUID prior to a variable:
    [Set(varApprovalGUID, GUID("12345678-1234-1234-1234-1234567890ab"));]
     
    It wont store data inside the variable varApprovalGUID.
    I dont know if this is some special behavior of the Embedded Page or something else.
    I also tried putting it at the OnStart property of the App, but that didnt work either.

    Kind regards
    GP
  • Suggested answer
    Ashish Mishra Profile Picture
    6 on at
    LookUp using GUID comparison not returning values, despite match
    Hi GP,
     
     

    Since  GUID() is non-delegable in Dataverse queries in PowerApps. Static GUID values or variables are fine — Dataverse can evaluate them server-side.

    Avoid runtime GUID() in queries. Store GUId as string or variable. Convert it explicitly :
    Set(varApprovalGUID, GUID("12345678-1234-1234-1234-1234567890ab"));
    Filter(YourTable, Approvals = varApprovalGUID)
     
    hope this answers your question.
     
    thanks
    Ashish 
     
  • grandepaci Profile Picture
    58 on at
    LookUp using GUID comparison not returning values, despite match
    Hi @stampcoin,
    Thank for the suggestion.
     
    It didnt throw an error, but also didnt load any data into my varApprovalRecords.

    Do you have another suggestion?

    Kind regards
    GP
  • Suggested answer
    stampcoin Profile Picture
    3,126 on at
    LookUp using GUID comparison not returning values, despite match
    I see... 😊
    try this one.
    With(
        { MyID: GUID( First(ModelDrivenFormIntegration.Data).ItemId ) },
        Set(
            varApprovalRecord,
            LookUp(
                'MDA Approvals',
                Approvals = MyID
            )
        )
    )
    
  • grandepaci Profile Picture
    58 on at
    LookUp using GUID comparison not returning values, despite match
    Hi everyone, thanks for your suggestions.
     
    I tried both your suggestions, but it wouldnt find any Approvals.Id.
    The 'Approvals' column alone gives the GUID.
    The column 'Approvals' is the Identifier and not a Lookup column.
    It is named Approvals, because the List previously had that name.

    Writing GUID() before 'Approvals' works, but also triggers the Delegation Warning.
    Is the problem then, that Power Apps needs a diffrent comparison for Dataverse GUID's?
     


    Thanks in advance.
    GP
  • Suggested answer
    Ashish Mishra Profile Picture
    6 on at
    LookUp using GUID comparison not returning values, despite match

    Hi GP,

    The root cause is that Canvas Apps treat GUID comparisons differently from Dataverse behind the scenes. Specifically:

     
    • The Approvals column in Dataverse is likely a lookup or a GUID-type column, but Canvas Apps interprets it differently depending on how the record is referenced.
    • When you use GUID(First(ModelDrivenFormIntegration.Data).ItemId), Canvas Apps treats this as a GUID type, but in Dataverse, lookup fields are objects, not just GUIDs.


    So this query: LookUp('MDA Approvals', Approvals = GUID(...)) - doesn't match because Dataverse internally treats lookup columns as records, not plain GUIDs.

    Correct way:
     
    Set(
        varApprovalRecord,
        LookUp(
            'MDA Approvals',
            Approvals.Id = GUID(First(ModelDrivenFormIntegration.Data).ItemId)
        )
    )
     
     
     
     
  • Suggested answer
    stampcoin Profile Picture
    3,126 on at
    LookUp using GUID comparison not returning values, despite match
     
    How to use GUID () function, please check this link GUID function
    You can use With to ignore the warning. but it doesn't mean eliminate the delegation problem.😊
    for example.
    With(
        { MyID: GUID( First( YourDatasource ).ItemId ) },
    
       
        Set(
            myVar,
            LookUp(
                'MDA Approvals',
                Approvals.Id = MyID
            )
        )
    )
    
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Featured topics