Imported Table Remove All Rows

If I have an imported table and want to remove all rows of data (outside of the Header row) every time a workflow completes, is there a more efficient way to accomplish this other than the options I listed below?

  • Tables: Delete a row - require batching over the imported table to extract the unique identifier and then using that as the lookup value in the Tables: Delete a rowaction
  • Tables: Copy a table to another table - require constructing a blank table in a workflow run with the same headers and then using Tables: Copy a table to another table action with Overwrite existing table set to TRUE.

For context, the use case requires individual runs of a workflow (each time a file dropped on SFTP) to write to an imported table and then clear out that table after all workflows complete.

Answers

  • Jozef_783863Jozef_783863 Posts: 263 admin

    My initial recommendation would be to use Tables: Copy a table to another table with the Overwrite option you mentioned. Assuming the table column headers are always the same, you can store a header-only Excel file as a file field default value. With this approach, you only need the one action.

  • Elia_321768Elia_321768 Posts: 12

    I need to fill the destination table with an ID
    I have tried to use the ID directly and also between {{ }}
    But it doesn't work
    Documentation said
    "If necessary, you can enter the Table ID directly. Change the left hand drop-down to ID then enter the ID manually. Learn more."
    but the drop-down doesn't exist

    Elia

  • Jozef_783863Jozef_783863 Posts: 263 admin

    Hi @Elia_321768,

    I will reach out to you from [email protected] and schedule a screen share call with you to help you with your setup.

    Thank you,

  • Jozef_783863Jozef_783863 Posts: 263 admin
    edited July 14

    @Elia_321768, based on your question here, can you use Excel: Save Spreadsheet to Table for your case?

    Excel: Save Spreadsheet to Table includes an Overwrite existing table option to replace spreadsheet data onto the Table ID.

    Excel: Save Spreadsheet to Table
    https://help.catalytic.com/docs/excel-save-spreadsheet-to-table/

    Overwrite existing table
    https://help.catalytic.com/docs/excel-save-spreadsheet-to-table/#overwrite-existing-table

    Feel free to send a reply to my email message if you prefer to discuss over email and set up a phone call together to discuss further.

  • Elliott_161118Elliott_161118 Posts: 1
    edited July 29

    @Jozef_783863, so when using Tables: Copy a table to another table in the manner you mention above will the table name be changed based on the value of the Output field prefix or is that only used if the existing table is not overwritten?

  • Jozef_783863Jozef_783863 Posts: 263 admin
    edited July 29

    @Elliott_161118 Based on my test, the source table name remains the same. Output field prefix from Tables: Copy a table to another table only returns summary information, rather than alter the source table name.

    Tables: Copy a table to another table > What will this output?
    https://help.catalytic.com/docs/tables-copy-a-table-to-another-table/#what-will-this-output

    Image 1 - Test Setup

    Image 2 - Source Table After Test

Sign In or Register to comment.