Referring to file created in prior automation/bot step

Is there a way to reference a file created in a previous automation/bot step?

I have the timestamp on the file and would like to write the path/name to a log file in a subsequent step. I attempted to use the [STEPNAME]. notation but it doesn’t recognize the step.

2 Likes

if understanding of your requirement is correct, what I would do is,

  1. Add a physical text column called say [Report_Timestamp] in the table that starts the bot. I would set that text column first through a bot step.

  2. In the next report generation step of the bot, I would use that column value in the report’s file name.

Example screenshots below.

A) The step highlighted in yellow updates the report time stamp column and the step in turquoise creates the report with a file name that uses the timestamp column updated in the previous step. Finally the step highlighted in red assign the file path to a file type column.

B) The Create Report TimeStamp step looks like below

The [Report_TimeStamp] column is set with an expression of TEXT(NOW(),“DDMMYYYYHHMMSS”) which is basically timestamp in textual format.

C) Now the report step has attachment file name expression as follows

The expression is as follows, that uses timestamp saved in the column as highlighted in yellow below

D) The generated PDF files have names as follows, wherein the timestamp part in each file is highlighted in yellow

E) The “Set File Path” step sets the file path in a file type column with an expression something like below

The expression is something like

CONCATENATE(“Appsheet/data/App_Root_Folder_Name/PDF_Files_Stoarge_Folder_Name/”,[Name],““,INDEX([Related Orders By Customer Name], COUNT([Related Orders By Customer Name])),””, [Report_TimeStamp],“.PDF”)

In the above expression , the part CONCATENATE(“Appsheet/data/App_Root_Folder_Name/PDF_Files_Stoarge_Folder_Name/…

sets the folder path whereas , the part

Name],““,INDEX([Related Orders By Customer Name], COUNT([Related Orders By Customer Name])),””, [Report_TimeStamp],“.PDF”

is nothing but the file name set in earlier step. Please do not forget to add the “.PDF” part in this last step to denote the extension type of the file.

4 Likes

I wanted to do something similar. Writing back to the file that launched the bot was not appropriate for what I wanted.

Rather, I added a step to create a record in a file creation log with some information related to the data. I wanted to reference fields from the step with the “Add new rows” action but those fields, from the table a new record is added to, are not available.

At least, not as a far as I can tell.

The file generation and upload is performed asynchronously, meaning the remainder of the bot’s process continues even as the generation and upload is in progress. The bot is never made aware when or even if the generation and upload succeeds. You could introduce a wait step in your bot that waits for the file column to get a value. My own experience with wait steps is mixed, so I wouldn’t expect it to work, but you could certainly give it a try.

2 Likes