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 / Field Being "Lost" Upo...
Power Apps
Answered

Field Being "Lost" Upon Variable Cast?

(1) ShareShare
ReportReport
Posted on by 94
I'm running into an issue I've never seen before: Among other fields, I have a Datetime field ("Created", wtn_created) in my Dataverse table (Magnet Board - Magnets).
 
Usually, when I do something like:
 
Set(_SelectedMagnet, First('Magnet Board - Magnets'))
 
I get a global variable record with all of the respective fields populated. However recently when I do this, wtn_created specifically is populated as blank in the resulting variable, even if it contains data in the table.
 
OnSelect property of a button control
 
Blank wtn_created field after control is selected
 
What might be going on here? The field is mentioned in no other place in the app, and all other fields are populated correctly; I even have other Datetime fields
 
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    395 on at
    Can you test and  confirm with below formula :

    Add a label:
    First('Magnet Board - Magnets').wtn_created
    try below instead existing 
     
    Use LookUp instead of First

    Set(
        _SelectedMagnet,
        LookUp(
            'Magnet Board - Magnets',
            ID = First('Magnet Board - Magnets').ID
        )
    )
  • Verified answer
    Valantis Profile Picture
    1,922 on at
     
     
    Power Apps is silently excluding wtn_created from the Dataverse query because it detects the column isn't referenced anywhere else in your app.
    This is called column pruning it's an automatic optimisation that works against you here.
    The fix is to force Power Apps to include the column.
     
     
    Option 1 — Hidden label (quickest)
    Add a label anywhere in the app, set its Text property to _SelectedMagnet.wtn_created, then set Visible to false. That's all — the column will now be fetched correctly.
     
    Option 2 — ShowColumns (cleaner long term)
    Replace your existing Set call with this:
    Set(
        _SelectedMagnet,
        ShowColumns(
            First('Magnet Board - Magnets'),
            "wtn_created",
            "wtn_due"
        )
    )
     
    This explicitly tells Power Apps which columns to retrieve, so pruning can never drop them again.
    Add any other fields you need inside ShowColumns.
    I'd recommend Option 2 if you want something more maintainable, but Option 1 will get you unblocked immediately.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • BenKraft Profile Picture
    94 on at
    @Valantis This. . .  works? It seems like a bit of an odd solution, since I now have to include every one of my columns in that ShowColumns() statement. Strange that you're not able to specify that all fields should be populated.
     
    While I technically don't reference the field by name in the app, it becomes an issue for me when I try to use the record variable in a patch statement and there are required fields missing. I technically also don't reference the row GUID anywhere in the app but it is present, is that just hardcoded to be included?
  • Suggested answer
    Valantis Profile Picture
    1,922 on at


    maybe just drop a label somewhere in the app, point its Text property to _SelectedMagnet.wtn_created and hide it.
     
    That should trick Power Apps into including the field in the query and you don't have to touch your Set() at all.

    for the Patch issue specifically, the hidden label is actually the more reliable fix since Patch can fail silently when required fields are missing from the record variable. Worth doing that sooner rather than later.

    As for the GUID, yes that one is always included automatically regardless, it's just how Dataverse records work under the hood.
     
    Unfortunately there's no way to turn off 
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 509 Most Valuable Professional

#2
Haque Profile Picture

Haque 302

#3
11manish Profile Picture

11manish 265

Last 30 days Overall leaderboard