Smartapp question about adding a new page

Hello,

I am working on smartapp project and was asked to add a new page in the existing single page app. Tried to add using the pageId, nextPageId values but it’s not working. Can someone suggest some sample code or thoughts on this implementation? We have some business logic in the existing single page and now asked to add a new page before this page and redirect based on submit.

Thank you!

Configuration | SmartThings Developers seems to provide a reasonable overview of how it is supposed to work:

  • You define the firstPageId in your CONFIGURATION INITIALIZE response. Let’s say it is '1'.

  • The first PAGE request received will have the pageId set to '1' (in this example).

  • You respond to that with the page definition with the pageId set to '1' and the nextPageId to the next page, let’s say '2'.

  • Another PAGE request will be received with the pageId set to '2'.

  • You respond to that with the page definition with the pageId set to '2' and previousPageId set to '1'. If there is another page you set the nextPageId and the cycle continues, otherwise you set complete to true.

1 Like

Hi, @sacssuresh
In the SmartThings Github repository, you can find a sample that helps you see how to configure the different settings available for a SmartApp.
It uses different pages for that purpose, so, it may help you see how to set it up.

If you’re still having issues with your particular SmartApp, you can share it with us over DM (me or @AlejandroPadilla) and we’ll help you check why it’s failing.

Yes, that helps. Do you have any documentation about applying CSS and styles in UI? The requirements have a large blue submit button to navigate to the next page and remove the cancel and Next buttons that come default.

You cannot use CSS or modify the UI. The documentation on the properties you can use in a SmartApp is in its repository here:

The requirements you mention are from your client?
From where do you want to remove the cancel and next buttons, the main page or the secondary page?
I don’t think it is an option on the main page and in a test I made, I don’t see any buttons for the secondary page.

Something important to note before continuing with the development is that SmartApps are for self-publish only. This means it cannot be distributed to other SmartThings users.

let me send the details in DM to you.