Should not be able to select same time for any date twice. How to do it?

I’m creating a table where I am writing down which social media post would be posted at what date and time.

Problem is, when specific date and time is selected for earlier post, it is possible (by mistake) to select same date and time in the table for a new post. I would have to memorize if any earlier post has already been scheduled for this particular day and time.

Ideal solution to that would be to not being able to select same time (greyed out options?) for any given date [one is date column and another is select list column where I have put up 9 AM, 3 PM and 6 PM as posting times]. Sharing the example table below.

Is this solution possible?
If not what could be the workaround?

Hi @Piyush_Patil

I’ve suggested for a similar wish in this thread : Programmatic date Range in Date columns - #3 by Quentin_Morel

Please have a look and tell me if this is ok for you ?
Using lookup custom filter is the best option I guess
In your case you should say that you don’t want to lookup already existing date

Hey man, nice to see you again.

I tried your suggestion. Do you mean having a separate table where I would have each date and time combination as separate row? Is that easiest possible way?

Let me check that one I have a moment :wink:

1 Like

OK Let’s do this @Piyush_Patil , lot of steps, I tried to be clear. Embed doc at the end but please read this to understand the process mate :wink:

BONUS 1
First of all, this is not sexy to have several times the same date in your lookup option, then I implemented this solution How to get Lookup columns to display only unique values?, so that you have unique value of date in your Pinterest table

Your Issue

We can indeed unauthorize you to select a time that has already been selected for the same day. Bonus 2 : if every hour of a given date has been selected, I wont let you select this day anymore (see below)

  • First step is to create a “date & time” column in your pinterest database, we’ll use that to compare in the “Date & Time” Table

  • Same in the date & time table

  • Then, we want to know in the date & time table if the combination of date/time has already been taken in pinterest table, create a checkbox with this formula

  • Back to pinterest table, set the time as “lookup”, and customize it to filter only time of current date, and corresponding to combination not already taken

  • So, in November 2nd, I have 3 possibilities in date and time : 1,2 or 3 PM. As 1 PM is already selected, checkbox is true, then in Pinterest table you cant select 1 PM any more. That’s the job you want !

Bonus 2
If all possible time of a given date have been taken, you’d like not to be able to select this date in the pinterest table

  • Create a “AllDayTaken” in date and time table, With this formula. It will run through every row of this date, and check if the time as been taken. If all of them are, the checkbox goes true. It means that there is no other time available for this date

  • Back to pinterest table, custom your date lookup filter to unauthorize row with AllDayTaken true

And you cannot chose Nov 2nd anymore !!

Conclusion
Yes, you have to deal with a second table of date/time, but this is I think the better way to proceed complex filter on date & time. But you can create easily this table as long as you want with button using ForEach/Sequence Button

Embed Doc

3 Likes

Hey man, that’s a huge help.

And being someone from a non-technical background, this was massive. Took me hours. And still somehow I could not get the right results :sweat_smile:

What am I missing?

Be my guest @Piyush_Patil. Time is money, then if you can save it, the best !

Could you allow your embed doc for me to edit ? So that I could make the modification and check what’s wrong directly on it ?

Cool

How do I do that? Do I need your email address?

Also, I’d like you to point out my mistakes so next time I want to do same thing, I’d understand the logic and steps.

Because, as we are doing this, I might as well use similar method for scheduling tables I have for platforms apart from Pinterest.

When you share your doc, please check that “edit” is on

image

Oh so should be editable by ANYONE.

Okay :+1: did it.
Please check.

Correction made in the doc :wink: this works now

1 Like

Thanks a ton.
Everything is working fine now.

1 Like

Hi @Piyush_Patil, I’m happy to have helped you solve this issue. A lot of different point seen in this post about unique value in lookup and custom filter ! Good look with your doc :wink:

1 Like

Hi all,

just to 100% finish this subject, I helped @Piyush_Patil with automatic creation of his Date & Time table, using @Xyzor_Max trick for a while loop, as it does not seem possible to run Multiple ForEach() https://community.coda.io/t/simple-while-loop-in-coda/29748

Then, OP has Date and Time he wants to fill with several date, and several times for each date. Then I created a TimeWithinDay Table, and also a creation table with :

The master creation formula is this one

  • As long as the difference between the “loopDate” and the EndDate is positive or equals to 0 I start a ForEach() loop on the TimeWithinDays table, I create as many rows in the master table, with the current time (CurrentValue) of TimeWithinDay table, and the current “LoopDate”. When I’m done, I change the value of loopdate to +1, and start the while loop again until LoopDate reaches end date.

To prevent issue, I ask the user to be sure that loopdate=startdate before I launch the main button

Quite scalable !!!

Here we go :

CPT2211021020-1300x726 (1)

I think this subject has been seen quite deeply now :wink:

2 Likes

Works perfect :ok_hand:
Thank you @Quentin_Morel :pray:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.