# How to make a button to export directly in the dashboard

**URL:** <https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153>\
**Category:** Help\
**Created:** [October 1, 2018, 11:54am UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153 "2018-10-01T11:54:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_A\_Franco](https://avatars.discourse-cdn.com/v4/letter/p/d9b06d/32.png) [@Pedro\_A\_Franco](https://forums.losant.com/u/Pedro_A_Franco)\
**Post date:** [October 1, 2018, 11:54am UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/1 "2018-10-01T11:54:35Z")

</div>

Hi !,

I need the node button in the dashboard for export a “data table log” of my device,  
this is a raspberry pi 3 b and I’m programming it with python to communicate it with Losant.

I’m tried with next configuration of node’s :

![Captura%20de%20pantalla%20de%202018-10-01%2013-53-46](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/1X/f404a103ce887488425fea6a7453fd300bc894df.png)

---

<div class="post-metadata">

**Author:** ![Erin\_Thompson](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/erin_thompson/32/501_2.png) [@Erin\_Thompson](https://forums.losant.com/u/Erin_Thompson)\
**Post date:** [October 1, 2018, 1:48pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/2 "2018-10-01T13:48:03Z")

</div>

Hi Pedro,

There are several different ways of achieving this goal, but I think this is the simplest way.  
First, create a workflow that uses a button as you have, and then use the Losant API Node to call [data table rows export](https://docs.losant.com/rest-api/schemas/#data-table-rows-export), which given an email address and a query will send an email with an attachment of the resulting data. After that add an [Input Controls Block](https://docs.losant.com/dashboards/input-controls/), add a control of type “Button Trigger”. Set the button trigger to trigger a “Workflow”, specify the name of the workflow you just created and the button to trigger the export.

Hope this helps,  
Erin

---

<div class="post-metadata">

**Author:** ![Hugo\_Hernan\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hugo\_Hernan\_Ruiz](https://forums.losant.com/u/Hugo_Hernan_Ruiz)\
**Post date:** [May 16, 2019, 3:58pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/3 "2019-05-16T15:58:37Z")

</div>

Hi, please I need your help… how I can to create the link or get the result file?

Tks!

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [May 16, 2019, 4:14pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/4 "2019-05-16T16:14:13Z")

</div>

Hi @Hugo_Hernan_Ruiz,

The link would be created on the dashboard with an [Input Controls Block](https://docs.losant.com/dashboards/input-controls/) that has a button. This button will trigger a workflow with your desired functionality. You can manipulate your data in the workflow (create a CSV, XML, etc.) and send it with an Output Node such as [Email](https://docs.losant.com/workflows/outputs/email/), [SMS](https://docs.losant.com/workflows/outputs/sms/), [Slack](https://docs.losant.com/workflows/outputs/slack/), [Sendgrid](https://docs.losant.com/workflows/outputs/sendgrid/), [Twilio](https://docs.losant.com/workflows/outputs/twilio/), and many others. The result file can be attached within many of these Outputs.

Please let me know if I can help further!  
Julia

---

<div class="post-metadata">

**Author:** ![Hugo\_Hernan\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hugo\_Hernan\_Ruiz](https://forums.losant.com/u/Hugo_Hernan_Ruiz)\
**Post date:** [May 16, 2019, 4:39pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/5 "2019-05-16T16:39:32Z")

</div>

Ok perfect, thank you! but how can I make the email file carry the attachment?

Now I have this result in the html body:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/1/1f660b798dcf55f4d7ce32833abae310a6e8b3ed.png)

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [May 16, 2019, 4:43pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/6 "2019-05-16T16:43:02Z")

</div>

@Hugo_Hernan_Ruiz-

A walkthrough on how to send an email attachment with SendGrid can be found [here](https://forums.losant.com/t/export-device-state-to-csv-ftp/1559/7), a walkthrough that also formats with a CSV Node can be found [here](https://forums.losant.com/t/export-device-state-to-csv-ftp/1559/11).

Thanks!  
Julia

---

<div class="post-metadata">

**Author:** ![Hugo\_Hernan\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hugo\_Hernan\_Ruiz](https://forums.losant.com/u/Hugo_Hernan_Ruiz)\
**Post date:** [May 16, 2019, 5:56pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/7 "2019-05-16T17:56:54Z")

</div>

Tnks! Thank you! How can I attach it using the Email node?

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [May 16, 2019, 6:54pm UTC](https://forums.losant.com/t/how-to-make-a-button-to-export-directly-in-the-dashboard/1153/8 "2019-05-16T18:54:32Z")

</div>

The SendGrid Node is simply a more advanced version of the Email Node and allows for more customization. Attachments are not available in the Email Node, but are in the SendGrid Node. If you do choose to change over to a SendGrid Node, you can still use your custom HTML, you will only need to change your “content” to allow for the HTML:

 ![23%20PM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/cad281f7559f52756adc26557ffb0f77b0fa5f13.png)

Thanks,  
Julia
