Skip to main content
Participating Frequently
May 27, 2019
Question

Auto Populate Calendar (with cut-off date)

  • May 27, 2019
  • 1 reply
  • 1351 views

Hi all!

I figured out the crossed-off issue (field calculation order), but still have one I'd like to tackle. Once I designate my "1" on my calendar, all the numbers fill in beautifully, but I need it to stop on a certain number without filling in extra spaces (i.e., August ends on the 31st, so I'd need the numbers to stop at 31).

Any help you can give is greatly appreciated! Keep in mind, I'm 100% new to this! It's all Greek to me.

Thank you for your time!

Leah

I found what I thought to be the solution I needed in a thread from years ago. I have a blank calendar template that I'd like to push out onto my iPad without having to manually fill it in each year (I'm a teacher and hate purchasing calendar/planners each year as well as the legwork I've been doing by manually filling in my own digital ones). The issue I'm having is that the following script works for the first two numbers, then the string stops. I checked to make sure everything was named correctly and that the custom calculation script follows the previous name (i.e. if the label is "Aug_2", the script reads "Aug_1"; label "Aug_3", script "Aug_2"; etc.)

Here's what I found previously in the forums:

if (this.getField("Aug_1").valueAsString!="") event.value = Number(this.getField("Aug_1").valueAsString)+1;

When I, for example, choose any box and fill in "1" the next box successfully fills with "2," but that's where it ends. I'd love if it would just continually fill the numbers in without any fiddling.

Message was edited by: Leah Dawdy

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 27, 2019

Please provide some more details about what you're trying to achieve and how you've set it up so far.
Are you using a script to populate the fields? If so, please post the code.

Participating Frequently
May 27, 2019

Sorry about that! I'm a teacher and tired of manually filling in my digital block plans and calendars (also tired of buying them each year). I found this script to populate the fields:

if (this.getField("Aug_1").valueAsString!="") event.value = Number(this.getField("Aug_1").valueAsString)+1;

It works beautifully to fill in the calendar dates. What I need to do now is add to the script to get it to stop at, say, 31 for the month of August.

try67
Community Expert
Community Expert
May 27, 2019

Are you filling it one month at a time? If you only have 31 fields for August, then why is this a problem? Also, not quite sure why you need to use a script for this in the first place... Isn't the value of "Aug_1" always going to be "1", and of "Aug_2" always "2", etc.?