Need help with IF / Then Statement in NX script

I'm having trouble getting started with the if then logic with some code I use.

"------------If Then Logic------------";
Need help with If amID = null end, else do below
"------------Core Scripting------------";
let sURL := "http://EXAMPLE:17790/api/externalminers/" + amID + "?key=EXAMPLE";
let response := do as server
http("GET", sURL)
'AM.json' := text(response)

In the above code, I've made two separate areas, the top being where I need help crafting an if then / statement.

Ideally if amID is null, I'd like the button to do nothing or alert "amID is not filled", but if the ID has any value, I'd like to run the code below.

I've tried to port over code from examples but it seems like I'm only addressing one line of the  Core Scripting when I try. If anyone can help me out here, you'll make my Christmas and I'll keep adding to my logic. I've just inserted psuedo code for now to demonstrate what I'd like to do. 

3 replies

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Maybe this :

    if amID != null then



    (no use of the else)


    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    != means is not null

    • OregonMines
    • TNT
    • 3 yrs ago
    • Reported - view

    Thank you Steven, it was my trying to include an else that had no function that was breaking it. Love ninox!

Content aside

  • 3 yrs agoLast active
  • 3Replies
  • 1289Views