Hey @elseb
Probably in your case you can use conditional formatting on the data points in the SP List.
First, you need to fetch the data points recorded in the SP List that correspond to the dates in your gallery. You can use a data source or collection to store the data points.
Once you have the data points, you can update the conditional formatting of the gallery cells based on the date range. For each cell, check if it falls within the date range defined by the key cells (e.g., between the 14th and 18th). If it does, apply the sky blue color. If there are additional gaps between other key cells, you can apply different colors accordingly.
You can use a similar expression as below:
// Define the start and end dates of the range
Set(startDate, DateValue("14-05-2023"));
Set(endDate, DateValue("18-05-2023"));
// Conditional formatting for the gallery cells
If(
ThisItem.Date >= startDate && ThisItem.Date <= endDate,
ColorValue("SkyBlue"),
If(
// Apply additional formatting for other date ranges if needed
// For example, between 18th and 20th in red:
ThisItem.Date >= DateValue("18-05-2023") && ThisItem.Date <= DateValue("20-05-2023"),
ColorValue("Red"),
// Default formatting for other cells
ColorValue("DefaultColor")
)
)
In the above expression, we use the If function to check if the date in each gallery cell falls within the range defined by the start and end dates (14th and 18th). If it does, the cell will be colored sky blue. If there are additional date ranges to consider, you can add more If statements to apply the desired colors accordingly.
Adjust the date values and colors as needed based on your specific date ranges and styling preferences. Additionally, make sure to replace the "DefaultColor" with the actual default color of the cells.
I hope this helps 🙂