If Statement
I am trying to create a calculation based on a couple of input fields. Essentially, on an editorial calendar post, if a person clicks on an "Acceptance Button" they will receive the "Amount Paid for the Assignment." If they choose "Rejection Button" they receive zero. The calculation below is what I am using but it still indicates I need to reference one other field. Stuck!
if (category == Writer Acceptance == 'Accept Assignment'){final_price = Amount Paid for Article;} else(category == Writer Acceptance == 'Reject Assignment'){final_price = '0';}
-
Official comment
Hi Bill,
Try this:
var final_price;
if (@Acceptance Button == "Accept Assignment") {final_price = @Amount Paid} else if (@Acceptance Button == "Reject Assignment") {final_price = 0}
Make sure you properly select the variables - simply pasting this in won't work, you'll need to type @ and select the right one :)
Comment actions -
Thank you very much Jacquelyn. While I was waiting for a response I actually found the following string that works:
switch (Writer Acceptance)
{
case "Accept Assignment": Amount Paid for Article;
case "Reject Assignment": 0;
}I then added an additional string in a related app using the following:
sum=Sum of Amount Paid for Article
Between the two strings it should give folks a couple of options on how to use it. Thank you very much for posting your response, it looks like it would work perfectly.
-
James,
It goes right into the calculation field in your app template :)
https://help.podio.com/hc/en-us/articles/201019358-Calculations
/Jacquelyn - Podio
-
Hi James,
I have not found a specific step by step guide for the If Statement. It really depends on where you want to place the code.
Here is a screen shot of where I first placed the code. http://screencast.com/t/RcoY0tw8y3dYou need to choose the app you want the calculation to appear in. In our case it was an Editorial Calendar app. Click into one of the items inside the app. Then choose Modify the template.
Then create a new field and choose the Calculation option.from the list of options on the left. You would then place the code in this field and save.
Next, in our case, we need to add additional calculations in a different app. We created a Writers App. and then added another calculation field to it. http://screencast.com/t/oUkTkHwAwM
This calculation essentially adds up all the money paid to a specific writer, once they have accepted an assignment.
Hope this helps a little.
Please sign in to leave a comment.
Comments
7 comments