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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Component Record Input...
Power Apps
Suggested Answer

Component Record Input Property / With() Confusion

(0) ShareShare
ReportReport
Posted on by 9
I have an input property to a component of type record (default/definition pictured):
 
 
I have a Dataverse table with the same column names. I understand that display names are different than schema names, so I understand that I am unable to do something like:
 
 
Since the names likely do not align in the backend. My thought was to "manually" create a record with With() from the returned Dataverse row:
 
 - A
 
I thought I could use the ThisRecord operator since the scope would be the Dataverse record. Just to test things, I tried this:
 
 - B
 
Which completely baffed me. Aren't I, here, regardless of the With() scope, returning the literal record {Name: "foo", Description: "bar, Image: "baz"}? How does it have none of the fields? Finally, I tried:
 
 - C
 
Which works perfectly. How is this different than using ThisRecord ? Or even just the record literal?
I have the same question (0)
  • Suggested answer
    SebS Profile Picture
    4,628 Moderator on at
    Hi,

    ThisRecord only has meaning inside record-scope functions, for example Filter, ForAll, AddColumns, GroupBy (and also galleries via ThisItem). In those contexts it refers to the current row being processed.
    With() doesn’t create a “current row” scope. It just creates named values (variables) for the expressions inside it — similar in concept to UpdateContext, but scoped only to the With() block.
    So inside With(), ThisRecord won’t automatically point to your Dataverse row. If you need the Dataverse row, store it in a variable (or use an alias like MyTable As dv) and reference dv.FieldName explicitly.

    This is how this function is set up and exist :)
  • BenKraft Profile Picture
    9 on at
    Hi @SebS,
     
    Thanks for the tips! I'm not sure if it's entirely accurate to imply that With() isn't a record scope function and therefore can't use ThisRecord;
     
     
    In fact, in other circumstances, it works perfectly well to use ThisRecord in regard to the first argument of With() as long as it is a record:
     
     
    Do you happen to have any guesses as to why something like the expression in photo B I've attached above might not evaluate?
     
    Thanks again!
  • SebS Profile Picture
    4,628 Moderator on at
    Yes, that’s fair to add. ThisRecord can work if you clearly define the record scope. When the scope is explicit (for example inside ForAll, Filter, or when a record is clearly being processed), Power Apps knows what ThisRecord refers to.
     
    When you use LookUp on its own, there’s no guarantee what record scope is active around it. In that case, ThisRecord becomes a guessing game — it depends on whatever scope already exists, which isn’t always obvious.
     
    If you introduce something like ForAll, you’re working with a table and a clear current record, so ThisRecord may work there — but at that point the logic becomes harder to reason about.
     
    That’s why the best practice is to name the record inside With() and use that name. It removes ambiguity, avoids relying on ThisRecord, and keeps the formula predictable and easier to understand.
  • SebS Profile Picture
    4,628 Moderator on at



    In this case you’re effectively confusing the scope you’re creating. With the first argument of With(), you’re saying: “this scope is based on a record returned by LookUp”. That record already has its own fields and shape.

    Then, in the same With(), you try to return a completely different record with hard-coded Name, Description, and Image values. Even though it looks valid to us, Power Fx doesn’t evaluate the second part if the first record argument isn’t cleanly resolved. It treats the whole With() as acting on the lookup record, and if that lookup is problematic or ambiguous, the formula fails before it ever gets to your hard-coded values.

    So it’s not that the hard-coded record is wrong — it’s that With() first needs a valid, unambiguous record scope, and here that scope is already confusing or failing. Once that happens, Power Apps reports “none of the expected fields” because the formula never actually reaches the part where you define them.

    That’s why naming the lookup result (or separating concerns) works better — it makes it clear what the scope is and avoids this kind of conflict.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 740 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 342 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard