cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
loganl
Level: Powered On

Inventory notification

Greetings all - 

I've modified the the Asset Checkout template to reserve quantities of items based on user input from a Text Input field. What I'd like is to display a warning if if they request an amount greater than what is currently on stock. 

The data is coming from a datafield called "Quantity" in my Excel sheet. I'm brand new to this, so if someone is feeling extra helpful and breakdown the formula for a dunce like me, I'd be very grateful. 

21 REPLIES 21
myke_deabreu
Level 8

Re: Inventory notification

Hi Logani,

 

You could create a Label and have the text to show "**WARNING MESSAGE**". Then on the "Visible" function of the label you could do something like:

 

#Reference where the quantity is being typed in:

Value(TextInput.Text)>LookUp(*excel_table*,item=*item_name*,Quantity)  

 

If the statement is true the label will be visible else it will be invisible. Not entriely sure how you have the template setup. If you have it in a collection it may be faster.

 

Let me know if this helped, provide some more information or screenshot of the varibles.

loganl
Level: Powered On

Re: Inventory notification

Thanks for that explanation - I'm getting an "expecting a number value" error. Here's what (I think) I know:

 

1) The form is setting a global variable of Set(ItemSelected, ThisItem). It's getting passed from a browse screen to a reserve screen, where I'd like the warning to display.

 

2) I've renamed the quantity field to "productquantityfield". So my visible formula for the error is: 

Value(productquantityfield.Text)>LookUp(Checkedout,ThisItem=productquantityfield,"Quantity")

 

Where Checkedout is my table name, and "Quantity" is the name of my table column. 

jhall
Level 8

Re: Inventory notification


@loganl wrote:

Value(productquantityfield.Text)>LookUp(Checkedout,ThisItem=productquantityfield,"Quantity")

Is it as simple as your comma mistake above?  Shouldn't it actually be:

Value(productquantityfield.Text)>LookUp(Checkedout,ThisItem=productquantityfield."Quantity")

loganl
Level: Powered On

Re: Inventory notification

Appreciate the quick help, @jhall - no dice. Now I'm getting

 

"Unexpected characters. The formula contains 'Ident' where 'Quantity' is expected.

"Expected operator. We expect an operator such as +, *, or & at this point in formula."

 

jhall
Level 8

Re: Inventory notification

After looking closer at your function, I'm not sure what you're really trying to do here.  

Value(productquantityfield.Text)>LookUp(Checkedout,ThisItem=productquantityfield."Quantity")

The bolded section has me scratching my head.  

This is just to see if we're trying to order more than what is available of a particular product, correct?  Is that what the LookUp() is supposed to be doing (getting the current amount available)?

 

loganl
Level: Powered On

Re: Inventory notification

Correct, @jhall - I'm trying to prevent a user from checking an item if the quantity they request is more than what is in stock. Beg your pardon for the ignorance on the structure of the formula; this was what was suggested to me earlier. 

jhall
Level 8

Re: Inventory notification

Well, to start w/ the basics, I'm assuming you got your Excel form by importing it into the application.  Via View | Data Sources | Add data source | import Excel.  So if you do the above series of clicks then you see something similar to:

image.png

From there, if you can do a quick test of linking this to a Data Table in PowerApps then that will help us in verifying field names and I can be specific.  Add a new Data Table via Insert | Data table.  Change the Items property to be the name of your Excel item from above (e.g. Table1).  Click the Fields property and select any/all fields associated with what we're doing here.  

You should now see a Data Table that shows rows/columns that contains data from your Excel document.  If you give me a screen shot of that (mainly column headers is what I care about) then I can be specific.

jhall
Level 8

Re: Inventory notification

Also, keep in mind that this data is NOT live (I seem to be typing this a lot today).  Excel imports with PowerApps are only done when you (the developer) refreshes this info.  So it is not "real time" for users.

The primary way to make Excel Tables and PowerApps display data that is in real-time is via linking both to a SharePoint List (or something similar).  PowerApps cannot link directly to Excel for real-time data.

loganl
Level: Powered On

Re: Inventory notification

Thank you @jhall - here's a snip of my "Checkout" table excel table fields. 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 206 members 6,253 guests
Please welcome our newest community members: