Hi,
This is regarding my previous post of Calendar view in Power Apps with Nested gallery on this forum and there were some changes by client, so basically I cant use the nested gallery (in the calendar) as it will create small boxes (of event subject) of one appointment for several times and there is no way I can merge that into a single box (as I am using nested gallery where these box subjects are there).
I approached in different way, where I didnt use the nested gallery and only used one Horizontal gallery.
As I mentioned before, I am building one calendar. The calendar should look like this below

I am currently trying to implement the day view. As you can see, the app should use outlook connectors to show the shared calendar (shared with the logged in user in power apps) appointment on power apps tool. For example, you can see the Petra's appointment or event (for a day) easily without opening the outlook calendar.
First (to get number of data between 8am to 7pm, at 60 minutes interval), I created collection using sequence and also to hold the integer value of the relevant time, I used DateDiff function, so it looks like below
With(
{
tvBlankSchedule: AddColumns(ForAll(Sequence(49),Time(8, 15 * (Value - 1), 0)),ValueInt,
DateDiff(
TimeValue("12:00 AM"),
Value,
TimeUnit.Minutes
)
)
},
ClearCollect(colCalendarDraft,
ForAll(
Sequence(CountRows(tvBlankSchedule)),
Patch(
Index(tvBlankSchedule, Value),
{RowNo: Value}
)
))
);
After this I used Get calendars action (by calling Power automate flow) and got the shared calendars (of Petra and Mirjam) and then used "Office365Outlook.GetEventsCalendarViewV2" to get the events for every shared calendar and created another collection to store this. Then created similar like above, I added two more columns (start app time and end app time) in appointmentevent collection which has the date diff value from 12:00 am in int. value and then I compared those columns with the ValueInt column of colCalendarDraft to get the final collection (named as colCalendarFinal)
The colCalendarFinal looks like this for any selected date now, where Appointment column has the table of appointments of events

So after this, I used horizontal gallery which will keep the time (from 8am to 12am) using the colCalendarFinal collection and under that I positioned several buttons (for each person) (for example- I used two buttons in this example for two persons) to showcase their events (positioned in vertical order in the horizontal gallery). Looks like below

As you can see the buttons are positioned vertically in the horizontal gallery.

The text of the button is changed to
First(Filter(ThisItem.Appointment,CalendarOwner = Dropdown4_1.SelectedText.email)).Subject - where I am currently comparing the person email from the dropdown to the appointment collection and adding the first found subject.
Now as you can see the single appointment for each person, but the person may have multiple appointments at the same time and it should show case that in this gallery as well. For example, Alireza may have Doctor's appointment from 8.30am to 10 am beside his status update event at the same time, how can I show case that in this example ? (without hampering the merging of items or buttons in horizontal way)
It will be very helpful if someone can give me any suggestion on this.
Thanks.