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 :
Power Platform Community / Forums / Power Apps / Validation in powerapps
Power Apps
Unanswered

Validation in powerapps

(0) ShareShare
ReportReport
Posted on by 68

I built a power app for inventory management.Actually when purchase qty is given in powerapp then it will add to sharepoint list column.Same thing for issue qty also.Now my problem is when the closing qty in sharepoint list is less than min qty of that particular item.It should not update or submit form and it should notify user saying qty is less and even when he request items greater than available it should say him stock not avalable.

Categories:
I have the same question (0)
  • KennyJ Profile Picture
    168 on at
    Re: Validation in powerapps

    Hi,

    the concept here is that you need to retrieve the current values from SharePoint and to do your calculation prior to completing the Patch.

     

    You could get the currently if the item with something like:

    UpdateContext({CurrentQty: LookUp(YOURDATASOURCE, ID = SelectedItem.ID, FIELD NAME)})

    SelectedItem.ID.  Usually if someone selected a record, I would set a variable with that records details, this way I can use it knowing it hasn’t changed and I can perform actions like this quite easily.   Different ways to do this,  it the principle is the same.

     

    Once you have return the current value you can perform validation on the qty in sharepoint - qty entered in your app.  Depending on your result you could then show a form of message, switch screens or if it’s OK, patch the record.  

  • likhith117 Profile Picture
    68 on at
    Re: Validation in powerapps

    @KennyJ 

    Your answer is quiet complex.

     

    See in the screenshot You can see type,stock available and qty(input).

    If user chooses issue in Type and entered a qty 1000(for example) but stock available is 500.Then it should be displayed that Stock not available and submit button be disabled.

     

    Please provide an formula related to it.

  • Verified answer
    v-albai-msft Profile Picture
    on at
    Re: Validation in powerapps

    Hi @likhith117 ,

    Seems the Type column is a Choice column, if so, you can set OnChange property of your QTY TextInput control to:

    Note: remember to replace DataCardValueType, DataCardValueQTY and DataCardValueStockAvailable with your own control names.

    If(DataCardValueType.Selected.Value="ISSUE" && 
    Value(DataCardValueQTY.Text)> Value(DataCardValueStockAvailable.Text),
    Notify("Entered stock is more than current stock!",NotificationType.Error))

    This will reminder users if the entered QTY is more than stock available.

    Then set DisplayMode property of your Submit button to:

    If(DataCardValueType.Selected.Value="ISSUE" &&
    Value(DataCardValueQTY.Text)> Value(DataCardValueStockAvailable.Text), DisplayMode.Disabled, DisplayMode.Edit)

    Best regards,

    Allen

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard