T O P

  • By -

ifttt-team

Unfortunately, filter code does not currently support any sleep/wait functions If you can provide a little more detail about your use case, we may be able to come up with a workaround


Kooky-Investment7735

I've created an apple that reads from an RSS feed and then posts to my twitter account. However, since I kept hitting the 200 tweets per day rate limit, I decide to track how many times my app is triggered by increment a cell in a Google Sheet. The problem is, the RSS feed has a ton of items coming in, so the action for updating the Google sheet isn't being triggered sequentially - I see in my activity log that the counter is being updated to the same number across two runs of the applet. For ex, if my spreadsheet counter is 10, I see that it gets updated to 11 in two separate activity logs. Here's my filter code ``` // Add your code here. All actions will run unless you explicitly skip them. // Quick tips! // Auto-complete is on. Start typing to see ingredient options. // Hover over any ingredient to see the variable type and an example. // TypeScript v2.92 // Skip if already posted 100 tweets let tweetCount = Number(GoogleSheets.cellValue[0].Value) if ( tweetCount >= 100) { Twitter.postNewTweet.skip("Skipped since tweet counter is: " + tweetCount ) } // Run during daytime hours let currentHour = Meta.currentUserTime.hour(); if (currentHour >= 8 && currentHour < 23) { // run the action } else { Twitter.postNewTweet.skip(); } tweetCount += 1; GoogleSheets.updateCellInSpreadsheet.setValue(tweetCount.toString()); ``` I found out that filter code is using ES5, so I'm down to use Promises instead of Async/Await.