• Resolved thetonguepad

    (@thetonguepad)


    How to create a formula as below:

    If match field with certain states, the rounded up value will be the weight of the parcel, and the result will be value i fill in the table?

    Or is there formula of shipping quotation based on state?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @thetonguepad

    I’m sorry, but your description is too general. So, I’ll try to describe a possible solution to a hypothetical situation:

    Assuming you have the DropDown field (fieldname1) with the states’ names.

    You can define into the equation associated to the calculated field, a plain object as database, whose attributes are the states’ names, and their values the corresponding shipping quotation, and for those states that are not in the object, you could apply some operations to calculate the shipping cost. Similar to:

    
    (function(){
        var states = {
            'State A': 12,
            'State B': 23,
            'State C': 34,
            'State D': 45        
        };
        if(fieldname1 in states) return states[fieldname1];
        
        /* Here the rest of the equation if the state selected is not in the list, remember to include the return instruction */
    })()
    

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Formula for Shipping’ is closed to new replies.