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 / Date Time Field does n...
Power Apps
Answered

Date Time Field does not show value in Canvas app form

(0) ShareShare
ReportReport
Posted on by 13

Hello Powerapps Community.

I'm new on canvas apps and I'm building a Timesheet app with Common Data Service.  I have two dateTime fields on my timesheet lines entity : StartTime and EndTime.  These fields do not pick up the value in the CDS whereas all other fields are doing it just fine.  I do not understand since I just added the field on the form.  On another form, I have a date only field which works fine.   

 

I have tried replacing the value in the default control to Text(ThisItem.'End Time',"[$-en-US]yyyy/mm/dd","en-US") for the End time field as this post suggests, but it did not work. 

 

Can anyone help ?

 

Thanks 

 

dflauzon2_0-1595294585456.png

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @dflauzon2 ,

    Could you please share a bit more about your scenario?

    Do you mean that the 'Start Time'/'End Time' field could not pull date time value from your CDS Enttiy?

     

    Based on the issue that you mentioned, I have made a test on my side , and don't have the issue that you mentioned. The screenshot as below:

    5.JPG

     

    Please make sure if the 'Start Time' field and 'End Time' field of the current record you are editing is populated with proper date time value. On your side, please set the DefaultDate property of the 'Start time' DatePicker control to following:

    ThisItem.'Start Time'

    or

    DateValue(Text(ThisItem.'Start Time', "mm/dd/yyyy"))

     

    Set the Default property of the Hours Dropdown box to following:

    Text(Hour(ThisItem.'Start Time'),"[$-en-US]00")

    Set the Default property of the Minutes Dropdown box to following:

    Text(Minute(ThisItem.'Start Time'),"00")

     

    I assume that you add a Gallery control in your app to list all available records from your Entity, you could consider add a Label inside the Gallery, set the Text property to following:

    ThisItem.'Start Time'

    or

    ThisItem.'End Time'

    then check if the Label could be populated with proper date time value, if not, it means that the 'Start Time' field or 'End Time' field of the corresponding record in your CDS Entity is Blank.

     

    If the 'Start Time' field or 'End Time' field of the corresponding record in your CDS Entity is not Blank, but the date time value still not be pulled into your canvas app, please consider remove the CDS Entity connection from your canvas app, then re-create a new connection to your Entity from your app, then try it again in your app, check if the issue is fixed.

     

    Best regards,

  • Daniel Lauzon Profile Picture
    13 on at

    Thanks @v-xida-msft  for the reply. 

     

    The complete scenario is that I have a "TimeSheet" entity on which I have a DataSet pointing towards my "TimeSheet Lines" entity.  The DataSet has a Hyperlinked column that when i click on it, I navigate to the TimeSheet Lines record.  This works fine as per below.

    dflauzon2_0-1595332963740.png

     

    My timesheet lines Edit form has the following in the Items control : DataTable_TimeSheetLines.Selected.  This opens the record that I selected in the prevous screen.  

    dflauzon2_1-1595333211912.png

     

    As you  can see in the screenshot, the value for the start time and end time are not retrieved.  The values should be the following : 

    dflauzon2_2-1595333344786.png

     

     

    I have tested to delete the connection for TimeSheet Lines and recreate it, but it did not work. 

     

    However, I have also tested to put the timesheet lines as a Gallery instead of having a datatable.  

    When I change the TimeSheetLines_Edit Form Items control from DataTable_TimeSheetLines.Selected to Gallery3.Selected,  it works.  The TimeSheetLines form retrieves the dates correctly.  

     

    The issue is that I do not want a gallery on my TimeSheet form.  I want to view the TimeSheetLines as a DataTable and not a Gallery.  

     

    Is this a bug ?  I am a bit bummed on why it would work with the Gallery and not the DataTable. 

    What are your suggestions to correct ?

     

     

     

  • Verified answer
    Daniel Lauzon Profile Picture
    13 on at

    Hi all, 

     

    I just found the issue.  My bad.  The fields that can be shown when you navigate a hyperlink of a DataTable are only the fields that are retrieved in the DataTable.  

     

    So, to show the values on the Start Date and End date on the record, I had to add the fields on the DataTable as per below. 

    And then, for each field in the DataTable, you put the Visible control to False

     

    dflauzon2_1-1595379191059.png

     

     

    This solves the problem. 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard