Execute JavaScript – Navigate to Specific Slide in Present
Hi Team,
I'm trying to navigate to a specific slide in a Present Pro dashboard using Execute JavaScript action (not Jump To Slide). I wanted to share everything I've tried so far in case anyone has a solution.
What I want:
- When a user clicks a button, if their role is Admin → go to slide 2
- If not Admin → show an access restricted popup
What works:
Contains(UserRoles(), "Admin")→ role check works perfectly- The popup for non-admins works fine
"alert('test')"→ works"document.dispatchEvent(new KeyboardEvent('keydown', {key:'ArrowRight', keyCode:39, bubbles:true}));"→ goes to next slide (one slide forward only)
What doesn't work:
pyramidApp.present.goToSlide(2)→ nothing happens (this was working till Sunday Night)pyramidApp.present.nextSlide()→ nothing happenspyramidApp.present.goToPage(2)→ nothing happenspyramidApp.navigateToSlide(2)→ nothing happenspyramidApp.present.navigate(2)→ nothing happenswindow.postMessage({type:'nextSlide'}, '*')→ nothing happensdocument.querySelectorAll('.tab-header-item')[1].click()→ nothing happensdocument.querySelectorAll('.tab-header-hotbox')[1].click()→ nothing happens- Dispatching ArrowRight twice with setTimeout → only goes one slide forward
DOM findings:
- No
<button>elements found in Pyramid's DOM - Found
.horizontal-arrows-scrollerwith child classes:tab-header-hotbox,tab-header-item,tab-text,selected - Clicking these elements programmatically does nothing
Question:
Is there any JavaScript API or DOM method available inside Pyramid's Execute JavaScript action to navigate to a specific slide by number?
The goToSlide() method in the docs only works for the Embed API (EmbeddedResult), not inside internal JS actions.
Any help or workaround would be greatly appreciated!
Thanks
1 reply
-
Hi
This isn't possible at the moment.
What you can do however, is to use the Jump to Slide with the advanced option, check the role of the user and if they satisfy the security criteria, jump to the relevant slide. If they fail jump to a slide that just shows a message, the whole slide covered by a button that when clicked, takes them back to the original slide. Then Hide (Pyramid 2025.10) that slide. The hidden slide will not show up using normal navigation tools, only if they fail the security test.
See attached video.
Hope that helps.
Ian