Customization for my project

Hello,

A feel days ago, I bought a “Salon Beauty” template on glideapps.com for an app that I used as the baseline for an app I’m developing (so basically I took the template I bought, copy it and created a new project). Despite some knowledge about customization and programing, I would like some help to improve the booking screen (to consider just available dates and hours for each professional).

Please, consider some examples:

Situation 1: If the merchant/expert works on workdays, so the weekend don’t have appear to the end user

Situation 2: If the merchant/expert works on workhours, the extra time (beyond workhours) don’t have appear to the end user

Situation 3: If a specific date and hour already have been booked by other user, this date don’t have appear for the rest of users

In summary, I need to create a booking logic, where the end user is allowed to chose just available dates and hours that weren’t booked previously by other users.

Please, could someone provide consultancy for me? Is there any place where I can hire freelancers qualified to develop this for me?

I recommend you watch this: https://www.youtube.com/watch?v=EBuTMEa_aFQ

and join Loqode School here: Loqode School

1 Like

Just my two cents here, all your booking logic would need to be handled by a post-choice error message. The built in components don’t allow you to integrate logic to not let users choose specific days/hours.

1 Like

I was surprised yesterday to find in my scheduling App, that if I have the action tied to conditional logic, the button for the action (or the menu option for the action) will not show if the condition is not met. I really hope this is expected behavior, and that it will not change, because it sure helps the look and feel of the app, and prevents actions from being taken if the conditions for the action are not met. Here is a screen shot where one task has a set date/time, and so the “calendar” action is enabled for it; another task is a one-time task, and so is able to be “completed”, and a third action is a daily task, and so neither the “complete” nor the “calendar” action is available for it. On another screen, I enable a “delete” button if the task is “completed”… This is also done simply by putting conditional logic on the action triggered by the button.

That is expected behaviour, at least for that component.

Hi Adam, thank you so much for the tip, was really helpfull!

Almost everything wasgood… Unfortunaly one step detailed on tutorial (at 1:16:14min to 1:16:45min - link to entire video >> Customization for my project - #2 by AdamMartin) it’s not working, because don’t return a any valid number.

The column would be related with the code below:

const Check = "p7";
if(Check === ""){ return "Nenhuma data selecionada."};
const AS = [p1];
const TS = [p2];
const BS = [p3];
const BD = parseInt("p4", 10);
const DS = parseFloat(("p5" / 1440).toFixed(4))
const DE = parseFloat(("p6" / 1440).toFixed(4))
const AvS = BS.filter(s ⇒ s >= DS && s <= DE);
const FrS = AvS.filter(s ⇒ !TS.include(s));
let VS = [];
FrS.forEach(s ⇒ {
	const SERaw = (s * 1440 + BD) / 1440;
	const SE = parseFloat(SERaw.toFixed(4));
	const RS = AS.filter(ss ⇒ ss >= s && ss <SE);
	if (RS.every(ss ⇒ FrS.includes(ss))) {
	VS.push(s.toFixed(4));
	}
});
if (VS.length === 0) {
	return "Não disponível nessa data.";
}
return VS.join(",");

The column on my project it’s not working:

Please, could you tell me how to fix it?

I haven’t watched the entire video, but it looks like he creates a template column for the javascript. In that template column, he has several replacement values. You should be sharing the resulting value from the template column here because that is the code that ultimately runs via the javascript column. Are your replacement values set up correctly? Do they all contain a value? If you share the resulting javascript here we can see if something is missing and try it ourselves. Be sure to use back ticks or the code block function when pasting code in the forum so it formats correctly. If you don’t know how to do that, just paste normally and I’ll add the code blocking.

Hellow Jeff, apparently the columns releated it’s ok, please see bellow (I don’t know how to use back ticks.

real example of the code running:

const Check = "terça-feira, 12 de dezembro de 2023";
if(Check === ""){ return "Nenhuma data selecionada."};
const AS = [0.0000, 0.0104, 0.0208, 0.0313, 0.0417, 0.0521, 0.0625, 0.0729, 0.0833, 0.0938, 0.1042, 0.1146, 0.1250, 0.1354, 0.1458, 0.1563, 0.1667, 0.1771, 0.1875, 0.1979, 0.2083, 0.2188, 0.2292, 0.2396, 0.2500, 0.2604, 0.2708, 0.2813, 0.2917, 0.3021, 0.3125, 0.3229, 0.3333, 0.3438, 0.3542, 0.3646, 0.3750, 0.3854, 0.3958, 0.4063, 0.4167, 0.4271, 0.4375, 0.4479, 0.4583, 0.4688, 0.4792, 0.4896, 0.5000, 0.5104, 0.5208, 0.5313, 0.5417, 0.5521, 0.5625, 0.5729, 0.5833, 0.5938, 0.6042, 0.6146, 0.6250, 0.6354, 0.6458, 0.6563, 0.6667, 0.6771, 0.6875, 0.6979, 0.7083, 0.7188, 0.7292, 0.7396, 0.7500, 0.7604, 0.7708, 0.7813, 0.7917, 0.8021, 0.8125, 0.8229, 0.8333, 0.8438, 0.8542, 0.8646, 0.8750, 0.8854, 0.8958, 0.9063, 0.9167, 0.9271, 0.9375, 0.9479, 0.9583, 0.9688, 0.9792, 0.9896];
const TS = [0.3750, 0.3854, 0.3958, 0.4063];
const BS = [0.3750, 0.3854, 0.3958, 0.4063, 0.4167, 0.4271];
const BD = parseInt("60 Mins ", 10);
const DS = parseFloat(("540" / 1440).toFixed(4))
const DE = parseFloat(("1005" / 1440).toFixed(4))
const AvS = BS.filter(s ⇒ s >= DS && s <= DE);
const FrS = AvS.filter(s ⇒ !TS.include(s));
let VS = [];
FrS.forEach(s ⇒ {
	const SERaw = (s * 1440 + BD) / 1440;
	const SE = parseFloat(SERaw.toFixed(4));
	const RS = AS.filter(ss ⇒ ss >= s && ss <SE);
	if (RS.every(ss ⇒ FrS.includes(ss))) {
	VS.push(s.toFixed(4));
	}
});
if (VS.length === 0) {
	return "Não disponível nessa data.";
}
return VS.join(",");

2 Likes

Hi guys, I figured out that Marco Volpato did an code update.

:rotating_light: 𝗨𝗽𝗱𝗮𝘁𝗲𝘀 :rotating_light:
#1 - I have updated the JavaScript snippet that is used in the Validation/Template column so it now allows the last slot of the day to be booked, and removes any Timeslots for the current day that have already passed. You can find the updated code in the Free Cheat Sheet.

After apply this update, I realized that the date values at p2 + p7 from ‘booking form’ - table, can’t be the same date from ‘bookings’ - table.

Because the logic consider if the date exist on ‘bookings’ table, it means that a booking has already been made before and the date/time should not be available.

Now it’s working. Thank you so much! :slight_smile:

1 Like

Awesome! Good to hear.

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