How to Set Up a Cron Job in Bubble to Fetch API Data Twice Daily and Insert into Daily Attendance Table?


Hi Bubble Community,

I’ve added an API in my Plugins API connector, and I’m looking to set up a cron job that runs daily at 11:55 AM and automatically fetches data from this API. The job should fetch data twice, with different URL parameters for each call, and insert the data into my daily attendance table.

Here’s the scenario:

  1. The API requires the following URL parameters:
  • sdate and edate: These should be set to the current date in yyyy-MM-dd format.
  • startindex: This is 0 for the first run and 100 for the second run. Both runs should happen at the same time.
  1. After fetching data from the API, I want to insert it into my daily attendance table. The format of the table is as follows:
  • Employee Name
  • Date
  • In Time
  • Out Time
  • Duration
  1. The cron job should run daily and execute two times at 11:55 AM with the same parameters except for startindex (0 for the first call and 100 for the second).

How can I achieve this in Bubble.io? Specifically:

  • How do I set up the cron job to run daily at 11:55 AM?
  • How can I dynamically set the sdate and edate to the current date and manage different values for startindex?
  • How can I structure the workflow to run twice with different startindex values and then insert the data into my attendance table?

Any guidance would be greatly appreciated!

Thank you!

Please check this video:




can you tell me where is the issue in my following workflows?

@vinaytadahal

Shall I need to upgrade from Free to Starter to run the cron job daily?