Use Bot to schedule CSV export from Slice?

Hey all!

Scenario: I have a slice of a table that I want to automatically download into a CSV file every Friday. I have a bot that runs every Friday and triggers a task to generate a CSV. Here's my problem:

When I set the Friday trigger to apply to EachRowInTable, it generates a separate CSV per row instead of one CSV containing all rows.

If I set the Friday NOT to hit EachRowInTable, it errors out and says it can't find the fields in my template.

I cannot point the trigger at a slice, only at tables it seems. I was then going to try an Action called Export this View to CSV but that also won't point at my slice, only at unsliced tables.

I'm obviously missing something here. How can I have a scheduled bot create one CSV every week containing all the rows in a slice?

 

PhilTheThrill_0-1644594872334.png

 

0 8 645
8 REPLIES 8

Share your expression inside the CSV template.

Make sure you have selected the right table under the Process config for your bot

Sorry we don't generate the best default CSV template in this case, but you can update the default CSV template to achieve what you want. 

You need to add <<Start: Select expression>> after the generate header values and before the generated row data values. The Select expression you specify should return exactly those rows you want to include in the resulting CSV file. You can use a Filter expression rather than a Select expression in the Start. Filter is just a simplified form of Select. If you are trying to export slice data, you should reuse the slice filter condition in the Select expression.

The Select expression specifies what table you are exporting from, so the column value references in the data row that follows will be recognized as belonging to that table.

Add an <<End>> immediately following the row data values. The <<Start>> and <<End>> bracket the row data values and we generate a CSV row for each record returned by the Select expression you specified in the <<Start: >>.

 

Make sure you set "EachRowInTable" to false. You only want your task to run once for the entire target table and not once for each row in the target table.

I am having the exact same problem as the original poster.  I have added a Select tag at the beginning of the row values as explained in the post above and and End tag at the end, but I still get the same error.  The Action does reference the correct table slice and foreachrow is turned off.  Any help?

I was able to fix this by copy-pasting the auto-generated CSV into notepad, saving it, and re-uploading it to Google Drive.

I managed to repro the same problem easily with my account, i.e. this is a bug for sure.

Hi All I am having the same issue, can you share how you were able to resolve the problem if resolved.

I was able to resolve the issue with creating a template based on https://support.google.com/appsheet/answer/11575675?hl=en&sjid=12560066552160584939-NA#manually-crea...

Example:

"Title","Assignee","Status","Date"
<<Start: Select(Table 1[Row ID], TRUE)>>"<<[Title]>>","<<[Assignee]>>","<<[Status]>>","<<[Date]>>"
<<End>>
Top Labels in this Space