Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Time not displaying in Editform

Posted on by

I have a sharepoint list and one of the columns is  Date Time.  In powerapps when I try to edit a form it displays the date correctly but the hours and minutes display as 0.

 

This is the default value for the hour and minutes 

If(EditForm1.Mode=FormMode.New,(Right(Text(Now(), "[$-en-US]hh:mm"), 2)),Text(Parent.Default))


When it's a new form it displays the correct date and time, but when I try editing an existing record it loads the date but the time is set to 0.

I am thinking it might be something with Parent.Default ?

Categories:
  • Rebetcha Profile Picture
    Rebetcha 645 on at
    Re: Time not displaying in Editform
    You are welcome! Glad I was able to help you.
  • Re: Time not displaying in Editform

    @Rebetcha  Thank you that was it.

     

    I modified the default value to 

     

    If(EditForm1.Mode=FormMode.Edit,Text(Hour(Parent.Default) ),Text(Now(), "[$-en-US]hh"))

     and it worked.

     

    Thanks for your help.

  • Verified answer
    Rebetcha Profile Picture
    Rebetcha 645 on at
    Re: Time not displaying in Editform

    Hi @Anonymous ,

     

    I think the issue is that you forgot to add the Hour() and Minute() functions in the Default property of the Hour and Minute dropdowns. Below the formulas as they appear when you use a SharePoint DateTime column without unlocking it. 

     

    HourDefault.pngMinuteDefault.png

  • Re: Time not displaying in Editform

    Hi @Rebetcha 

     

    I am using the standard control when you import from sharepoint.  The date field is a date control and the hours and minutes are a drop down. 

     

    The DataCard contains the following update :

    DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)

     

  • Rebetcha Profile Picture
    Rebetcha 645 on at
    Re: Time not displaying in Editform

    Hi @Anonymous ,

     

    In that case I think the issue is in what is saved to SharePoint when you submit the form.

    The formula you shared states that the current time is loaded in case of a new item. Is the form not in New-mode, than Text(Parent.Default) is loaded. 

    If(EditForm1.Mode=FormMode.New,(Right(Text(Now(), "[$-en-US]hh:mm"), 2)),Text(Parent.Default))

     Can you please share the following information?:

    • Which controls you use within the data card connected to DateTime column.
    • What the formula is in the update property of this data card.
  • Re: Time not displaying in Editform

    I verified that Date and Time was selected.

  • Rebetcha Profile Picture
    Rebetcha 645 on at
    Re: Time not displaying in Editform

    Hi @Anonymous ,

     

    Is it possible that you did not turn on the Include Time option for your SharePoint column?

    By default a Date and time column in SharePoint is date only. 

     

    DateTimeColumn.png

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,733

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,750

Leaderboard