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 / How to restrict the Us...
Power Apps
Answered

How to restrict the User to input text box to HH:MM:SS format

(0) ShareShare
ReportReport
Posted on by 709

Hi Team,

 

How do I restrict the User for the input text box to HH:MM:SS format.

 

So that no Text or but Number in HH:MM:SS can be the punch in.

 

akbarmahfuzalam_0-1597752317653.png

 

Categories:
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    As far as I know there is no way to do that. There is also no way I know to actually format what the user puts in the input so that it will match standard phone number format -  I know it has been requested. The only way around I have figured out is to make a separate text input field and parse that. Then put the parsed values in a string which you push into the filed input.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @akbarmahfuzalam 

    In Power Apps there is no way to restrict data input to 'time format'.

     

    My suggestion would be to create 3 text input like this

    Capture.JPG

    Change the Format property of each text input to this code to ensure only numbers are typed

    Format.Number

     

    Then set the MaxLength property to this code.

    2

     

    Now you can get the time in the desired format using one of these methods.  You can choose what works best: 

    Text(Value(TextInput_Hours.Text), "00") & ":"
    & Text(Value(TextInput_Minutes.Text), "00") & ":"
    & Text(Value(TextInput_Seconds.Text), "00")
    Time(Value(TextInput_Hours.Text), Value(TextInput_Minutes.Text), Value(TextInput_Seconds.Text))

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • akbarmahfuzalam Profile Picture
    709 on at

    @mdevaney ,

     

    Thanks for the option which you suggested. It works but I landed into some other problem. Wherein, I have used the formula for submit button 

     

    oncurrent(
    Notify(
    "Submitting your records...",
    NotificationType.Information
    ),
    ForAll(
    ExceptionHoursBULKGallery.AllItems,
    If(
    !IsBlank(HoursExcptHrs.Text),
    Patch(
    ScoreCardExceptionHours,
    Defaults(ScoreCardExceptionHours),
    {
    Date: SHIFTDtExcptHrs.Text,
    EID: EIDExcptHrs.Text,
    LOB: LOBExcptHrs.Text,
    'Employee Supervisor': SupExcptHrs.Text,
    'Exception Hrs': HoursExcptHrs.Text,
    Reason: ReasonExcptHrs.Selected.Value,
    'User Name': FNameExcptHrs.Text
    }
    )
    )
    )
    );
    Notify(
    "All records have been submitted successfully!",
    NotificationType.Success
    );
    Set(gvReset,true);Set(gvReset,false)

     

    But since it no more remains blank

     

    akbarmahfuzalam_0-1597754638713.png

    How do I overcome this? Because I 

  • akbarmahfuzalam Profile Picture
    709 on at

    @mdevaney ,

     

    So Basically I want If the user enters nothing then it should remain Blank

  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @akbarmahfuzalam 
    Maybe you could change the Default property of HoursExcptHrs to this code so it remains blank until a user enters one of: hours, minutes or seconds?

    If(
     !IsBlank(TextInput_Hours.Text) Or !IsBlank(TextInput_Minutes.Text) Or !IsBlank(TextInput_Seconds.Text),
     Text(Value(TextInput_Hours.Text), "00") & ":"
     & Text(Value(TextInput_Minutes.Text), "00") & ":"
     & Text(Value(TextInput_Seconds.Text), "00"),
     Blank()
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • akbarmahfuzalam Profile Picture
    709 on at

    Thanks for solving the issue

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