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 / Defining an input fiel...
Power Apps
Unanswered

Defining an input field as mandatory and defining the criteria for the manual input

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, I have a list of manual input fields which are supposed to be numeric entries.

1) How do I set the criterion so that this field is mandatory, i.e. if the entry is blank, then an error message or warning shows up?

2) The numeric entry is supposed to be time (in minutes). How do I set the criterion so any entry <0 or >60 will not be accepted?

3) How do I set the criterion that only whole number is accepted, so I don't want anyone to input a decimal place because that would mean seconds. I only care about whole minutes.


Thanks in advance. I am 2 days old with PowerApps. Appreciate the quick help as I have something due tomorrow 😞

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    Create a new label to hold an error message.  Put this code in the Text property:

     

    ”You have an error”


    Next put this code in the Visible property of the error label:

     

    IsBlank(TextInput1.Text)=false

    And Value(TextInput1.Text) >= 0

    And Value(TextInput1.Text) <= 60

    And Value(TextInput.Text) = RoundDown(Value(TextInput1.Text))

     

    Now the error message will show when there is a problem with the entry.

     

    Finally, put this code in the DisplayMode property of your submit button to prevent a submission while there is an error present

     

    If(Label_ErrorMessage.Visible=true, DisplayMode.Disabled, DisplayMode.Edit)

     

    ---
    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."

     

     

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

    Hi @Anonymous ,

    1. You can do this at the Save function

    If(
     !IsBlank(YourControlName),
     Notify( "Field xxx is required",NotificaitonType.Error),
     SubmitForm(YourFormName)
    )

    2. Same principle

    If(
     Value(YourControlName.Text) <1 || Value(YourControlName.Text) >60,
     Notify( "Field xxx is requires value between 1 and 60",NotificaitonType.Error),
     SubmitForm(YourFormName)
    )

    3. Same again

    If(
     Mod(
     Value(
     YourControlName.Text
     ),1
     )>0,
     Notify( "Field xxx is requires whole numbers",NotificaitonType.Error),
     SubmitForm(YourFormName)
    )

     

    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.

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

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Warren, I wasn't able to follow it, but a colleague on my team who is better at PowerApps took over my task. I will still like to learn and explore your solution. Thanks.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard