Count and Depend of the result make other step

Hey there !!

  • I’m Trying to connect Whatsapp Cloud with google sheets. I have done it so far… But I want to create a new row in google sheets ONLY when the first message comes in. not all the messages (Because I dont need much more, and because I wan to decrear the amount of operations done)
  • I’m trying to get all the records in my google sheet and filter them and count it… But i dont know if there is any better way.

image

  1. To get all the records currently in your google sheet you can use the Search Rows module then connect it to an array aggregator, add some filter to ensure the row is a valid record. Then use length(Array) from your array aggregation.

  2. For handling the messages could you provide some clarity on the incoming data from Whatsapp that you use to create the row, for example do you receive an array of messages?

2 Likes

Hey !!

Thanks for your response.
If I simplify my question. I want to create a row for the First message ONLY, how can I do it ?

If you only want to add a row for the first message, use the search module to check if the phone number is equal to the phone number from WhatsApp. Then, apply a filter: ‘bundle order position doesn’t exist.’ If the Google Sheet search module returns 0, a new row will be added to the sheet.

3 Likes

Hey RBalani !

Thanks for your response, It worked perfectly !
Thank you.

One Last question. Make will count each message as an iteration, isn´t it ?
So if someone sends me 1.000 messages in 1 month it will count ass 1.000 iterations even though is only 1 chat. Am I right?

3 Likes

Yes, if you receive 1000 messages in one month, it will count as 1000 operations just for WhatsApp. The next module, ‘Search Number,’ will use another 1000 operations. If, for instance, you have 500 unique numbers among those 1000 messages, an additional 500 operations will be used for the ‘Add a Row’ module. In total, the count will be 2500.

2 Likes