Forum Discussion

DanialAsghar's avatar
DanialAsghar
Qrew Trainee
6 years ago

Button with conditional logic

Hello, 

We have a PO system made using Quickbase which currently has different statuses. 

Currently our implementation uses form dynamic rules check which status the PO currently has... then it creates a Button using the following which will change its status to awaiting confirmation: 
var text URLONE = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_33=" & URLEncode("Awaiting Confirmation of receipt of goods 2")...

The second rule checkes the Button if the second status is enabled and if so it creates a button to change the status to one of the other statuses. 

I am trying to make the code more refined by having creating a button which has conditional logic built in so instead of having 2 buttons, we can just have one.... Can anyone help guide me on how I can do that. Effectively on the form load I want the button to check which status it is in, then if status 4 show that button, if status 4.1 show that button and otherwise dont show a button at all... 

Thank  you!
  • You can use regular If() statements in URL buttons the same way you would in a formula text or number field. 

    So something like this if you're using generic formula-url buttons 

    if( 
         [Status]=1,api call goes here for your button,
         [Status]=2,different api call goes here for your button,
         [Status]=3,different api call goes here for your button,
    "")

    Basically the status will determine what URL to pop in. If the If() condition isn't met - pop in "" at the end and the button will show nothing to link to.


    Chayce Duncan | Director of Strategic Solutions
    (720) 739-1406 | chayceduncan@quandarycg.com
    Quandary Knowledge Base