Build two paths depending on whether an excel worksheet exists

:bullseye: What is your goal?

My automation weekly reads an excel that gets new entried every day and filters for last week’s rows with a specific value in one of the columns. I then want it to create a new worksheet named with today’s date in another excel and just copy in some of the colums from the filtered rows.

So I want it to take specific new data from workbook1 and weekly copy it into a new tab in workbook2

:thinking: What is the problem?

The issue: I cannot seem to get the filter right that checks whether the new excel worksheet exists and if not, do it, and if yes, just write in it.

:test_tube: What have you tried so far?

I use List Worksheets to check which worksheets exist. On this I try to base the filters after a router that has two routes. Then I have tried:

  • using the text operators contains/doesn’t contain and equal to/not equal to on the array.name of the List Worksheets module
  • using an array aggregator after the List Worksheets module and then using the array operator Contains/Does not contain in the filter
  • all different kinds of ways to format the date which is the name of the new worksheet (mostly forcing it to be a string), but I have tried parseDate and using a date operator in the filter as well.

Can anyone help?

:camera_with_flash: Screenshots: scenario setup, module configuration, errors


Hey there,

array.name doesn’t work like you think it does. It pulls the first item of the array’s name value, not all the name values of the array.

You can use map(array;name) to get a primitive array with only the names and then use contains to check if the name exists.

1 Like