Calculation based on Item field name
Hey everyone!
I am currently trying to stretch Podio to its limits in using it to maintain inventory and stock level counts of our EMS supplies. What I need is an easy input (which I have created with no issue) and a way that is easy to understand for our equipment manager to order new items when we run low (also have that solved). What I am running into as an issue is getting the two Apps to communicate properly so that the stock level automatically update the total in our supply, to further complicate things we have 5 locations that we store items at.
What I have for the input is fairly straight forward, the user would put in the inventory in a simple webform with the date, their location, and how many of each item they have, this will all be one webform and not individual items.
What I have for the equipment manager to view is broken down by item not by date of inventory or location, so what I need to do is have a formula that will grab only the item from each inventory.
The issue I have is in the app for the equipment manager the calculation won't change for each item so we get the same number for each item's output.
My solution thought is to have an 'if'/'else if' calculation loop which will check the name of the item then use that item name to get the numbers from the inventory so it would look like this:
if (@item name == '2x2'){
@2x2 needs + @2x2 received
}
else if (@item name == '4x4'){
@4x4 needs + @4x4 received
}
Continued down until all items are listed in the calculation.
This works but its a bit clunky, is there an easier way?
-
Hi Matt,
is @needs + @received an addition (plus) or should both values been displayed?
Maybe you can use a markdown table:
var name = @all of name;
var needs = @all of needs;
var receive = @all of receive;var result = [];
for(var i = 0; i < needs.length; i++) {
result.push(name[i] + " | " + needs[i] + " | " + receive[i])
}"Item-Name | # Needs | # Receive \n" +
"--- | --- | --- \n" +
result.join("\n")The result should be a table with 3 columns and "Item-Name", "# Needs" and "# Receive" as header and as table content
2x2 xx xx
4x4 xx xxBut to get a correct table it's necessary to have values in each field (name, needs reveice) in every item (or you have to create another if-condition to define on which items thecalculation should be executed).
Rainer
rg@delos-consulting.com
Please sign in to leave a comment.
Comments
1 comment