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 / Label doesn't show var...
Power Apps
Unanswered

Label doesn't show variable until I type the property again ...

(0) ShareShare
ReportReport
Posted on by 10

I have a variable varDate that stores a date and time, e.g. "01.01.2022 08:00". I need to show the content of the variable on different labels, sometimes the whole thing and sometimes only the date or the time. 

When I set the properties of a label as "DateValue(varDate)", it should show "01.01.2022", and it does - but only if I go into the label's properties, delete and type one of the letters again, like I need to force PowerApps to apply the property and then it works. If I only start the app, the label will be empty, as if it doesn't execute the property by itself.

The same happens with "TimeValue(varDate)" and even just "varDate" - I need to tell it to give me "Text(varDate)" to see the contents in a label. 

 

What am I doing wrong?

Categories:
I have the same question (0)
  • venka91 Profile Picture
    1,119 on at

    On which property of the label you have given this DateValue(varDate) and TimeValue(varDate)

    I have given it to Text Property of the label and they come as they are.

     

    venka91_1-1645695278491.gif

     

     

    venka91_0-1645694858637.png

     

  • Kobalt Profile Picture
    10 on at

    I have put it in the text property, as well. They work fine when I do this the first time. When I close the app, start it again and set the variable - then the labels don't work until I "force" the execution of the property by typing a part of it again.

  • venka91 Profile Picture
    1,119 on at

    Are you setting the varDate at the Start of App ? then the variable must be set when the application is launched.

  • Kobalt Profile Picture
    10 on at

    I set it on one of the screens via a date and time picker and then use it in multiple other screens. I understand that my labels can't show anything if the variable isn't set, but they don't when it is set, either - until I do what I described, which makes me think that the variable itself is okay, it just doesn't work with it automatically. It works when I just delete the "D" from "DateValue(varDate)" and type it again (that is, I don't change anything about the variable itself, only the label property), and then it will work fine until I close the app and start it again. 

    By the way, the "Text(varDate)" always works from the start, but when I only type "varDate" as the text property of the label, it doesn't show anything.

  • venka91 Profile Picture
    1,119 on at

    No, it looks the syntax is wrong. though you get it through Date time Function or from any other controls, the variables must be set to the values. Please post the formula you are trying to do with this problem.

  • Kobalt Profile Picture
    10 on at

    I have a date and time picker on a screen. To leave the screen, you klick a button that does the following:
    Set(varDate; dte_DateDay.SelectedDate + drp_DateTime.Selected.Value)

    The variable then shows up in the list of global variables with the data type "DateTime" and the correct content.

  • venka91 Profile Picture
    1,119 on at

    This sets me the date and time as you mentioned.

     

    venka91_0-1645698082115.png

     

  • Kobalt Profile Picture
    10 on at

    Exactly - and for me, it all goes downhill from there. 😉 
    With the variable set like this, I insert a label (or a text field, same result) anywhere in the app, and set the properties as discussed. It works, the label shows the desired contents.

    Then I save, close the app, open it again, click on the button - and the label stays empty. I put my cursor into the label's property box, put in a letter or space or anything, and as soon as this happens, the label shows the correct information. Then it keeps working until I close the app again. 

  • venka91 Profile Picture
    1,119 on at

    The variable gets cleared when the app is closed. 

    If you Click on the Button after relaunching, it sets the variable value. Hope Datepicker and Dropdown are not set to allow empty when app is loaded.

    I think this label property or the variable property is somewhere conflicting. Please recheck the existence in all the screen onvisible, onhidden property or some place where you have used it.

    Most probably it is a misplace of variable usage and not seems to be a powerapps issue or bug.

  • venka91 Profile Picture
    1,119 on at

    also please check the onchange property of you label.

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard