web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : uAzOBSukcJc4eb585GDXZX
Power Apps - Building Power Apps
Answered

Field Validation , Greater than 0

Like (0) ShareShare
ReportReport
Posted on 10 Aug 2020 22:51:50 by 95

Hi,

 

I have a field called " Quantity" (Part of  a Collection) ,  Default Value is 0,  I want user to enter value greater than 0 and if they miss, prompt message should appear "Enter value more than 1".

Since the default value is 0, I don't want this validation appear on form Load. 

 

The back-end is SharePoint list.

 

Thanks in Advance.

 

Pbala

 

 

PBala_0-1597099744280.png

 

I have the same question (0)
  • PowerAddict Profile Picture
    7,314 Most Valuable Professional on 11 Aug 2020 at 16:52:26
    Re: Field Validation , Greater than 0

    Glad I could help! Good luck with the rest of the app! Feel free to reach out in case of any questions!

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • PBala Profile Picture
    95 on 11 Aug 2020 at 16:31:57
    Re: Field Validation , Greater than 0

    Thank you very much, your solution worked.

  • Verified answer
    PowerAddict Profile Picture
    7,314 Most Valuable Professional on 11 Aug 2020 at 01:50:52
    Re: Field Validation , Greater than 0

    Have you tried this? Where you have the Patch function, add this:

     

    If(Value(LineQuantity.Text)>0,
    Patch(
    ExpenseCollection,
    ThisItem,
    {
    ddlValue:Dropdown1.Selected.Item,
    LineCost: LineCost.Text,
    LineQuantity: Value(LineQuantity.Text),
    LineSize: LineSize.Text,
    LineTotal:Value(LineTotal.Text),
    ShowSaveButtons:false
    
    }
    ),
    Notify("Please enter a quantity greater than 0", NotificationType.Error)
    )
    ;

     

    Let me know if this works. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Microsoft Business Applications MVP

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • PBala Profile Picture
    95 on 11 Aug 2020 at 01:11:45
    Re: Field Validation , Greater than 0

    Thanks for the response.  

     

    Are you using Pqtch or SubmitForm for submission? 

     

    I am using Patch function to submit to the Collection. 

     

    Patch(
    ExpenseCollection,
    ThisItem,
    {
    ddlValue:Dropdown1.Selected.Item,
    LineCost: LineCost.Text,
    LineQuantity: Value(LineQuantity.Text),
    LineSize: LineSize.Text,
    LineTotal:Value(LineTotal.Text),
    ShowSaveButtons:false

    }
    );

     

    Also, are you saying that the validation should only happen if the user has replaced the default 0 with 0 or 1? And is the validation that the number entered by the user should be greater than 0 or 1? 

    Default Value is 0, I want the validation to occur if the user has not replaced the 0 with value greater than 0.

    The validation number should be greater than 0. 

    I am not submitting the form to the SharePoint list, if the line item quantity is 0. I want to visually prompt the user that they need to add quantity value greater than 0.

     

    Let me know so I can guide you with the best possible suggestion.

     

    Thank you very much.

     

     

  • PowerAddict Profile Picture
    7,314 Most Valuable Professional on 11 Aug 2020 at 00:20:09
    Re: Field Validation , Greater than 0

    Are you using Pqtch or SubmitForm for submission? 

     

    Also, are you saying that the validation should only happen if the user has replaced the default 0 with 0 or 1? And is the validation that the number entered by the user should be greater than 0 or 1? 

     

    Let me know so I can guide you with the best possible suggestion. 

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

     

    Thanks!
    Hardit Bhatia
    Microsoft Business Applications MVP
    https://thepoweraddict.com

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete