0

Auto-populate tax depending on another dropdown field selection?

I'm wondering if it's possible to tell Ninox to apply tax based on my 'job type' dropdown field? For example, if  I pick 'shipping' that would be taxable, but 'design' (as a service) isn't taxable in my case. Attached is a screen shot to help visualize.

Even better if I could have it default to 10.1%, then if I need to change it I could.

Thanks!

5 replies

null
    • Daniel_Berrow
    • 8 mths ago
    • Reported - view

    Hi Taylor,

    There are various methods you could use for this, the option i'd look into is using a switch case

    https://docs.ninox.com/en/script/introduction-to-ninox-script/set-conditional-statement/set-multiple-conditional-statements

    'Tax rate' := switch 'job type' do
    case 1:
    10
    case 2:
    20
    default:
    10.1
    end
    

    Put a script like this in your update trigger in job type, and fill in your tax values for each case it needs to be different, and then your default can be 10.1 for ones not needing anything else specific

      • Taylor_Hanson
      • 8 mths ago
      • Reported - view

       Thank you! I'll give it a try.

      • Taylor_Hanson
      • 8 mths ago
      • Reported - view

       so I got it to work using a formula field, but can’t get it to work using a number field. The only issue with the formula field is that I can’t type into it if I need a misc percentage.

      Here’s my formula, any ideas? 
       

      'Tax Test' := switch 'Job Type' do
      case 1:    ""
      case 2:    "10.1"
      case 3:    "10.25"
      case 4:    "10.1"
      case 5:    "10.0"
      default:    ""
      end

      ‘Tax Test’ is the number field I’m trying to get to work.

      Thanks!

      • Daniel_Berrow
      • 8 mths ago
      • Reported - view

       You'll need it in the trigger on update section within "job type" so whenever you pick a job type it then updates your "Tax Test" field

      • Taylor_Hanson
      • 8 mths ago
      • Reported - view

      that's it, thank you!

Content aside

  • 8 mths agoLast active
  • 5Replies
  • 78Views
  • 2 Following