Button from Block doesn't redirect

Hello, I have this button
That active this workflow
The problem is that the Endpoint: reply never redirect. No matter what configuretion i use.

Thanks :slight_smile:

Hi @Jonathan_Calderon,

I really appreciate the screenshots. It’s a huge help.

From the looks of it, you are trying to redirect an experience page from a dashboard Input Controls Block. This will not work, as the Endpoint: Reply replies to a specific endpoint request. This is why your page is not redirecting.

Could you tell me a bit more about what you are trying to accomplish? From what I can gather, it looks like you might be trying to allow your Experience users to set a threshold for a device, and then redirect them to a different page. Is this correct?

With a little more information about your use case, I might be able to provide a solution.

Thank you,

1 Like

Hi Heath, yes your observation is correct. I’m trying tu save the treshold an then reload the same page to refresh a gauger. Maybe if i try with custom html block inside the dashbord? With a form can do the same . What do you think? Another thing that i try is take the ID of the botton and add the function reload with javascript in the layout but doesn’t work because i cant access at the context variable

@Jonathan_Calderon if what you’re after is redirecting the user after they click a button, I don’t think a Custom HTML Block will work, because that block exists inside an iframe on the dashboard and it does not have access to the outer scope of the parent page.

Now, there is a way you could get there from a click of an Input Controls Block button, but it’s going to take some work. I did something similar to this in our Device Provisioning Deeper Dive (starting at about the relevant point).

The steps involved are, broadly …

  • Create a new Experience Endpoint in your application. The method should be GET; you can make the path whatever you want.
  • Using a workflow, set that endpoint to reply using an SSE stream, pointing at a custom MQTT topic.
  • In the workflow that is handling the Virtual Button press from the Input Controls Block, add an MQTT Node that publishes a message on the custom MQTT topic that is backing the streaming endpoint.
  • In the page / layout that’s wrapping the dashboard, open a request to the streaming endpoint you created using the EventSource API on page load.
  • In the message callback for the EventSource integration you set up in the page, add some code to look for the particular message you are publishing on the custom MQTT topic.
  • When that message is received, redirect the page or reload using JavaScript

Let me know if this helps. It’s a lot to set up to get the experience you’re after but it should be possible.

1 Like

Hi Dylan, how are you? Thanks for the reply :slight_smile: . I was reading your solution and it’s great but, at the end, i resolved the problem with a form in the layout. Thanks for the answers Heath and Dylan i appreciate it :slight_smile: