Help with trigger file creation url

Hi there,
need some help here.
I have a workflow that does some processing to time series data and generate a CSV file.

When the user press the button, I would like to show the URL of the actual CSV file.

How do I include the value of the file create result into the dashboard?

Pressing a Virtual Button - through the API, through an actual press in a workflow, or through an Input Controls Block - does not return a result other than { "success": true }. If you wanted to present the URL of the file in a dashboard, you would have to save that value as a string attribute in device state and then present that attribute in another block. This could also present problems if other users are interacting with this block as well.

A better approach would be something like this:

  1. In the Input Controls Block, add an “Email” text input, which the user should put their email address into.
  2. On press of the button, fire your workflow as you’re doing now. You’ll have to adjust it to also pass that email address through in the payload.
  3. After the File: Create Node, add a SendGrid Node. Use it to send an email to the submitted address that includes a message and the link to the file you just created.

This solves the dashboard problem as well as giving the user a more permanent way of storing that URL if they need to come back to it in the future.

1 Like

That is actually a great idea, it saves me from creating a user experience page.
Is there also any plan to eventually also include the returned payload of a workflow?
Cheers.

Not at the moment; if we added any kind of support for your original idea, more likely it would be allowing a Custom HTML Block to make an HTTP request and get a response from that - in which case you could have the request go to a Losant webhook, from which you can indeed issue a reply. The question then becomes, where do we display that reply to the end user?

I’ll put a +1 on that particular request for you, though I can’t say at this time when or if we will select it for development.

1 Like

That would work too, yes thanks for the consideration!