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 / Formatting of times th...
Power Apps
Answered

Formatting of times that are entered as text

(0) ShareShare
ReportReport
Posted on by 171

I have an input field in text format to allow the input of hh:mm. The whole thing is also sent as text through a patch into the dataverse. I am trying to allow alternative input formats like: from 900 to 1700, meaning that 900 is formatted to 9:00 and 1700 to 17:00.

Categories:
  • TheRobRush Profile Picture
    11,128 Moderator on at
    Text(
     Value(
     Concat(
     MatchAll(
     TextInput.Text,
     Match.Digit
     ),
     FullMatch
     )
     ), 
     "##:##"
     )
  • alt88 Profile Picture
    171 on at

    i am getting following issue 

    Bildschirm­foto 2023-03-13 um 16.02.45.png
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Yah you can't put that in its own default. If you want it to visually change in the textbox itself it would need to do something liek this

     

    put a slider control in, make its default

    Len(TextInput1)

     

    make it's OnChange

    UpdateContext({defaultFormat:
     Text(
     Value(
     Concat(
     MatchAll(
     TextInput1.Text,
     Match.Digit
     ),
     FullMatch
     )
     ), 
     "##:##"
     )});
    
     Reset(TextInput1)

     

    now make your textinputs default value

    defaultFormat

     

    hide your slider and ce voila

     

  • alt88 Profile Picture
    171 on at

    the default of the input field is currently thisitem.starttime. how do I connect the two so that the start time from the dataverse is displayed there + I can make new entries that are correctly formatted with defaultFormat?

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    When you load the form add this in UpdateContext({defaultFormat:Blank()})

     

    Then set that controls default to

    If(!IsBlank(ThisItem.starttime) && IsBlank(defaultFormat), ThisItem.starttime, defaultFormat)

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard