Scripting

Screen Switching

You can switch between different screens within your application. This is particularly useful when you want to display or manipulate different data. To create the switch, you need a function that controls the switch based on a button press. When creating the function, it is important to create a new parameter of type “Number” under “Parameters.” Within this function, you create an If-Else statement. Use your created parameter as the condition and compare it to a number that represents the desired screen.

    if  ButtonNumber == 1 then
	    runtime.showscreen('Screen1')
    elseif  ButtonNumber == 2 then
        runtime.showscreen('Screen2')
	elseif  ButtonNumber == 3 then
        runtime.showscreen('Screen3')    
    end

If_screenchange

Finally, create a button that calls the switching function. Pass the number of the desired screen as a parameter.

Navigation(2)

Button_screenchange

We are learning from you!

Did you find this article helpful?

Be enlightened!

Do you need more support?

Peakboard Youtube icon Visit our YouTube channel

Our numerous videos for beginners and advanced users explain exactly how to design your dashboard.

Peakboard Templates icon Visit the Peakboard Templates

Download our templates for various use cases for free.

Peakboard icon Visit www.peakboard.com

Find out all about Peakboard and browse our different use cases and success stories.