Triggering a bot for an email with attached CSV and virtual column calculation

Hi. I am trying to create an automation where the management can press a button and whatever they see on their view will be sent an email with the csv file containing 9 records. + have some calculated columns included in the email body (virtual columns from Overtime table)

Table is “Overtime”. This is filtered down to lets say 9 records thourgh a slice “For SDM”. My problem is that if I select the bot trigger to be an update, the csv file will be generated through the bot with the line that was changed only. Not what the view currently is. The normal download button is not enough, as I would have to have some virtual columns calculated, then inserted into the email body. Which works. But I can not seem to be able to trigger the bot in a way where it brings all the records from the view.

Is there a way that I could create some combination of actions that would trigger my bot but the csv would contain all records that the user currently sees?

What you want to do is very likely possible. Please post screenshots of the entire bot configuration.

The calculated values are coming through correctly, but the file only has 1 line.
Because the bot reacts to changes, when I test it I change one columns value to trigger it, but when its generates the file, CSV it only generates 1 line, the one that was changed.

I never needed a bot that looked all the data regardless of what changed and at the same time the user needed the ability to trigger it. How could I trigger it with a button but for all the data not just for the row context that is being updated?

Your template needs to use a <Start> block to include and format the rows you want to display.

Friendly reminder to mark the solutions :slight_smile:

I was suspecting that. Is there a way to trigger a bot on a button press without modifying anything in the table? As in this case I would have a lot of records, and I just want the user to press a button in case they need this report. I dont want them to go and change a line’s value, just so the bot triggers.

You can have a button that changes a value in a different table, and a bot that responds to changes in that different table and generates a report from this table.

For instance:

  1. Create a table named (e.g.) Report Triggers with columns:

    • Trigger (Text, key, required, initial value: UNIQUEID())
    • Timestamp (DateTime, required, not editable, initial value: NOW())
    • From (Email, required, not editable, initial value: USEREMAIL())
    • To (EnumList of Email, required)
  2. Create a bot on Report Triggers that responds to adds (only) by generating a report using For SDM (not the trigger table), and sending it to the email addresses in the To column of the added row of the trigger table.

  3. Create an action on Overtime of type Data: add a new row to another table using values from this row that adds a row to Report Triggers and sets to To column using the expression, USEREMAIL().

  4. Add the action where you want the user to be able to trigger a report.

The Report Triggers then also provides a log of who requested reports and when.

I’ve structured Report Triggers so you could easily add the option to allow the user to specify additional or alternate recipients. You could also easily add Cc, Bcc, and Subject if you wanted. You’d need to use more than just a button trigger, though, to allow the user to add or modify those. For instance, instead of adding the row directly, the button sends the user to a form view on the Report Triggers page where the user can modify the subject and recipients.

If you wanted to generate other reports, you could expand the Report Triggers table to capture the report identifier, then configure the bot to handle it.