Hello all!
I'm trying to build a PowerApp that will be used for re-ordering items from an inventory, but I'm running into an issue where I can't get the current item amount to show based on a selection from a listbox. Can someone help me out with the formula?
In the current quantity I want it to show the value I have in the columns "Quantity in Reorder" and "Quantity Overall" in the FFD Inventory SP list:
So it needs to filter that data source to the listbox selection and provide the sum of the values in those two columns. Any thoughts?
Currently I have
Sum(Filter('FFD Inventory', Sum('Quantity in Reorder' && 'Quantity Overall'), ListBox1.SelectedItemsText.Value))
but it isn't working.
Many thanks!
Solved! Go to Solution.
If your ListBox is set to the datasource items, then you simply need the following:
ListBox1.Selected.'Quantity in Reorder' + ListBox1.Selected.'Quantity Overall')
Avoid using the SelectedText property as it is deprecated.
I hope this is helpful for you.
If your ListBox is set to the datasource items, then you simply need the following:
ListBox1.Selected.'Quantity in Reorder' + ListBox1.Selected.'Quantity Overall')
Avoid using the SelectedText property as it is deprecated.
I hope this is helpful for you.
My List box is distinct, here's the formula for the listbox:
Sort(Distinct('FFD Inventory', Description), Ascending)
The reason it's not datasourced is because if I use 'FFD Inventory'.Description' in Items it shows as blank:
So since it's not a direct datasource, how would your recommendation look via code?
I tried this and it didnt work:
Sum(Filter('FFD Inventory', Sum(ListBox1.Selected.'Quantity in Reorder' + ListBox1.Selected.'Quantity Overall')))
Thank you!
Yes, that formula will not work.
So my question though is this - if you are doing a distinct (meaning there could be more than one record with the same description), then when you do a sum, which record are you trying to sum?? Or are you trying to sum all of them?
If you are trying to sum all of them, then this Formula should give you what you need:
Sum(
Filter('FFD Inventory', Description=ListBox1.Selected.Result),
'Quantity in Reorder' + 'Quantity Overall'
)
Only reason I use distinct is because it showed the results - is there another function I can use rather than Distinct?
Also, just trying to sum the columns "Quantity in Stock" and "Quantity in Reorder" from the SharePoint list.
Hope this clarifies - thanks!
Disregard, I was able to get the ListBox to be a direct datasource and then the formula you linked earlier worked. Thank you!