Csv email widget

Are there any plans for a dashboard widget that has a similar function as the ‘request data export’ function within the Losant UI (under device actions)?
We can’t seem to do this in a way where the end-user isn’t emailed a Losant-branded email with the csv download link. It would be great if the user could just input their target email address and a target timeframe, with the device ID being determined by dashboard context (or from a dropdown).

Thanks,

Allan.

The closest thing we have is the “Download as CSV” option in the Device State Table - which is similar but not exactly the same as what you are describing. And we don’t have any plans to add a device data export block to dashboards anytime soon.

What you’re trying to accomplish can be done outside of a dashboard within your experience, however.

  • You can accept a device ID, target email (defaulting to the experience user’s email address), start and end time (as Unix timestamps) in a simple web form. That submission fires a workflow through an Endpoint Trigger.
  • Using a Device: Verify Node, you can verify that the user making the request has access to the device they are requesting. You can also validate other parts of the request using a Validate Payload Node.
  • Using a Losant API Node and the Device: Export API action, you can request an export using the start and end time provided by the user.
    • You would also include a callbackUrl - and not an email - in the request, pointing the callbackUrl to a Webhook. The email address to where the result should be sent should be encoded as a query parameter on the request.
  • In a Webhook Trigger, you receive the result of the request, which includes a link to where the data export file can be downloaded. That is then included in the body of an email in a SendGrid or Mailgun Node, which you then fire off to the email address included in the webhook request.

We have a template that demonstrates some of what I described here: Experience User Dashboard Requests.

That template uses a resource job to iterate over experience users and send personalized dashboard export emails on a regular basis. You would want to rip all that out and replace with the endpoint request validation and processing I described previously.

But you could then update the Losant API Node to use the Device: Export Action, and everything downstream from there is pretty close to what you need: A webhook to receive the response and the target email address, and a SendGrid Node for pushing the resulting export file out to the user.

Many thanks for your reply Dylan, we’ll try the solution with the Losant API Node :slight_smile: