Hello everyone,
This is my first post so I apologize in advance if it's in the wrong place or format.
Here is my problem. I have created an app to use for inventory purposes. The basic premise of my app is that users will select which location they are completing the inventory for, conduct an on hand inventory, generate a report that calculates inventory required based on min-max data, and then submit.
To this point everything has gone well, I have been able to pull the sharepoint data into a collection, display it properly in the gallery, have + - buttons in the gallery that patch the adjusted current inventory values back to the collection, and navigate to the submit screen which filters the collection to only show the data which requires ordering (ie anything which is >0 and < min order shows up, everything else just shows a 0).
Now the problem. I originally had a Sharepoint column that would calculate (Max Stock - Current Stock, in an IF statement to ensure it only applies if the current stock was lower than the min stock and above zero). The problem was that I couldn't patch the collection back to the Sharepoint list because the calculated column wouldn't accept an update (makes sense to me, the column is calculated and therefore read-only). I changed the sharepoint column back to a number column and have been attempting some version of a calculated column in a collection but am at a total loss as I cannot seem to write the IF statement into the PATCH properly.
My data source is station4, my collection name is colorder, and the if statement is as follows,
If(
And(
Max_x002e_Stock-CurrentStock>0,
CurrentStock<Min_x002e_Stock
),
Max_x002e_Stock-CurrentStock,
0
).
This all works if I ClearCollect it into another collection (colmath) using AddColumn (Picture added below) , but then the column names don't match and I still can't patch to update the station4 datasource.
Any suggestions would be greatly appreciated!
Thanks,
Shawn