If Statement



  • Official comment
    Jacquelyn May

    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 Permalink
  • Bill Walls

    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.

    Comment actions Permalink
  • James Hayward

    Wondering if there is a step by step guide to where you place this code?

    Comment actions Permalink
  • Jacquelyn May


    It goes right into the calculation field in your app template :)


    /Jacquelyn - Podio

    Comment actions Permalink
  • Bill Walls

    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/RcoY0tw8y3d

    You 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.

    Comment actions Permalink
  • James Hayward

    Thank you Bill

    Comment actions Permalink
  • ESDC

    var finalPrice = (@Acceptance Button == "Accept Assignment") ? @Amount Paid : 0;

    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk