cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dflauzon2
Frequent Visitor

Date Time Field does not show value in Canvas app form

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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. 

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 ?

 

 

 

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. 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (19,342)