Jump to content

Auto-enter next value in value list for new record?

Recommended Posts

I am just working on an appointment reminder system and I would like to create a set of records each day for the next day's appointments. In general, appointments are half hourly and mostly only one for each timeslot.

I'd like each new record to auto-enter the appointment time 1 slot (30mins) later than the time slot in the previous record.

At the moment the timeslots are in a value list from 8.00AM to 5.00PM in 30min intervals. Once I've created the record for the 10.30AM slot I'd like the next record to auto-enter as 11.00AM etc. My current method is to do it by calculation from the time data in the timeslot field from the previous record by using the value of the n-1th record (where n is the total number of records) and adding 30 mins but this feels more complicated than perhaps it might need to be.

If ( Get ( RecordNumber ) =1; "8:00 AM" ;GetAsTime (GetNthRecord ( Time ; Get ( RecordNumber ) -1 )) + GetAsTime ("00:30:00"))

Is it simpler (or possible) just to select from the values in a value list?


Edited by muzz

Share this post

Link to post
Share on other sites


You could get the values from your value list using GetValueListItems and then go through a loop creating new records and taking the next value from the list of values to set for each new record. This way, it would be more flexible in the future as you could just change the value list if your appointment slots changed, and the script would continue to work without modification.

I've done a little sample file to show you what I mean.

Try running the script within, and it will create new records from the value list.

Value Lists.fmp12.zip

Share this post

Link to post
Share on other sites

Thanks rwoods. I probably didn't give as much information as I should have.

The appointment calendar is not integrated into Filemaker, we are using Apple Calendars on a Mac. The current workflow would be to manually create one reminder record at a time, enter the appointment time and enter the client code which would then pull the mobile number in and create the message to be sent.

Not all clients have a mobile or wish to receive a reminder, or an appointment slot may not be filled so not all time slots will be used. Sometimes the appointments may start later in the day or vary for some other reason.

I just thought it would be easier to select an appointment closer to the last appointment made in the drop down value list rather than defaulting to the start time or any other time for that matter if entering the field if it is necessary to change the time.

Thanks for your solution though - I may have use for it in another table and appreciate your effort.


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.