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 / Date Time Picker, User...
Power Apps
Unanswered

Date Time Picker, User selected time not coming in Edit Mode

(0) ShareShare
ReportReport
Posted on by 73

Hi folks

I have a Date Time datacard and converted time from 24 hrs -12hrs Format. The process are as follows:-

 

  • Inserted a Dropdown with Item property as - ["AM", "PM"] and default property as If(Hour(Now())<12,"[$-en-US]AM","PM")
  • Minute Datacard update property to Minute(Now())
  • Hour Item reduced upto 12 and set default property as Text(If(Mod(Hour(Now)),12)=0,12,Mod(Hour(Now()),12)),"[$-en-US]00")
  • & Update property of the whole datacard as DateValue1.SelectedDate+Time(If(Dropdown2.Selected.Vakue="PM",12,0)+Mod(Value(HourValue1.Selected.Vakue),12),Value(MinuteValue1.Selectes.Value),0)

Everything work fine as expected in New Mode but when I get into Edit Mode it still shows Current time rather the earlier already selected/defined Time.

 

Any way how to achieve this. ?

 

I am using a SP list Customized in PowerApps

 

 

 

 

 

 

Categories:
  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @sharjeel_123 ,

    Your issue will be the Default of the controls - the three drop-downs in particular - what are these values ?

  • sharjeel_123 Profile Picture
    73 on at
    • Inserted a Dropdown with Item property as - ["AM", "PM"] and Default property as If(Hour(Now())<12,"[$-en-US]AM","PM")
    • Minute Datacard Default property to Minute(Now())
    • Hour Item reduced upto 12 and set Default property as Text(If(Mod(Hour(Now)),12)=0,12,Mod(Hour(Now()),12)),"[$-en-US]00")
  • sharjeel_123 Profile Picture
    73 on at
    • Inserted a Dropdown with Item property as - ["AM", "PM"] and Default property as If(Hour(Now())<12,"[$-en-US]AM","PM")
    • Minute Datacard Default property to Minute(Now())
    • Hour Item reduced upto 12 and set Default property as Text(If(Mod(Hour(Now)),12)=0,12,Mod(Hour(Now()),12)),"[$-en-US]00")
  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    Hi @sharjeel_123 ,

    You are asking it to show the current time in the Default, so it is doing exactly that. Here is a post of mine showing the Edit/View mode values - you are going to need to make different conditions for the Mode the form is in - have a go and I will be happy to look at the code.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • sharjeel_123 Profile Picture
    73 on at

    I did followed this approach earlier but it's working only in the new form

    New Form is Showing current time in 12hrs format as expected but in edit form it should show the default selected time and not the current time.

     

    I also tried giving conditions like If(sharepointform1.Mode=FormMode.New sort of but its also showing current time in my edit form which i don't want

     

     

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    @sharjeel_123 ,

    Can you please share the code (in Text) you attempted to do this. I will give you a start with the Hour

    With(
     {
     wTime:
     If(
     YourFormName.Mode = FormMode.New,
     Now(),
     ThisItem.YourDateTimeField
     )
     },
     Text(
     If(
     Mod(Hour(wTime), 12) = 0, 
     12, 
     Mod(Hour(wTime), 12)
     ),
     "00"
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard