Forum Discussion

JulieMeeker's avatar
JulieMeeker
Qrew Trainee
2 years ago

Generate a record for each day in the month with a pipeline

I need to generate a record for each day in the month for the next month.   (there are several child tables that will be associate with each day so I need the base days for the month).  I have a miscellaneous table that has the first and last day on the next month, but using a search step performs one iteration.  I thought about incrementing and then doing an on event step.  I have not been able to figure out a way to make a pipeline iterate through to create the records.  Any suggestions would be appreciated.

------------------------------
Julie Meeker
------------------------------

3 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger
    Here's a stupid simple approach for those who are not into fancy Jinja looping syntax.
    Make a helper table with 31 records in it. Number the records in a field called [Day #] from 1 to 31.

    Make a formula field to calculate the date of the current month.  Call it [Date]. 

    Today() + Days([day #]-1) 

    Make a Checkbox field called [Day is in current month?]

    Month(Today()) = Month([Date])

    Then have a pipeline run every month to search that table every month for where the 
    [Day is in current month?] is yes and then FOR EACH Loop to create a record in the target table. 


    ​​​

    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • PrashantMaheshw's avatar
      PrashantMaheshw
      Qrew Captain
      Mark ,
      Brilliant KISS Solution !

      ------------------------------
      Prashant Maheshwari
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew #1 Challenger
        Thx 
        I realize this would be a better formula 

        FirstDayOfMonth(Today()) + Days([Day#] + 1)

        that way the formula will work on any day of the month and you won't have to catch it right at the first of the month to make it work.

        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------