Filter question: Only add a GDocs sheet if needed

Hello,

my quesiton is similar to this one, but the answer here is missing.

I have a web hook which receives the name of a sheet name which should be created in a Google spreadsheet.

Before that, I need to check whether the sheet already exists.
What I did:

List the sheets

This returns multiple bundles.

Aggregate the bundles

Filter before adding the sheet
CleanShot 2024-05-18 at 16.34.09


Executing the webhook:

branch = name of the sheet to create:
CleanShot 2024-05-18 at 16.36.51

(The array aggregation shows that there is already a sheet with that name)
CleanShot 2024-05-18 at 16.35.56

I expect the filter to block the creation of the sheet.
But instead, the filter passes and I get an error that there is already a sheet with that name (which is true…)


Question: what is wrong with the filter?

Thanks a lot - regards,
Simon

You might not even need a List Sheets module.

Just directly add to your sheet name, and if an error occurs, create a new sheet and add the row to your new sheet.

I have this in a live scenario:

Screenshot_2024-05-19_023611

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes

Thanks Sam,

this looks interesting - I like the way you are handling the error and react on it!

In my case, it’s indeed only the creation of the sheet which I need when I push a certain branch to github. This calls the webhook with the branch name as argument in the JSON payload.

I am just wondering, where do I have the error in the filter? (see the screenshot)

Thanks a lot!
Regards,
Simon

Problem solved.
I overlooked that the key in the output is not Title, but title. :man_facepalming:
Thanks anyway for your help!
/Simon

2 Likes

Hey @smake :wave:

Thanks a lot for sharing additional info about your problem and the solution! :pray:

Keep up the good work :star:

1 Like