Hello,
I have a gallery that shows me several days of the week like in the screenshot below. However, I would like to indicate to the left of the dates, the corresponding day of the week. But I can't do that 😞
Could you help me please? Thanks in advance !
For anyone reading this, here is the answer from the other thread that references the same question.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Show-days-of-the-week/m-p/1686847#M429256
Text(DateValue(Label4.Text); "ddd")
Text(DateValue(Label4.Text); "dddd")
Hi @s44
Now you can add the switch case.
Switch(Weekday(DateValue(Label4.Text);Sunday);1;"Sunday";2;"Monday";3;"Tuesday";4;"Wednesday";5;"Thursday";6;"Friday";7;"Saturday")
or
Switch(Weekday(DateValue(Label4.Text),Sunday),1,"Sunday",2,"Monday",3,"Tuesday",4,"Wednesday",5,"Thursday",6,"Friday",7,"Saturday")
Small typo.
It's "Weekday()" with a lower "d".
Thank you for your very comprehensive answer. But it still doesn't work 😞 @poweractivate
@s44 I already told you before in a few recent responses, don't use ThisItem.Label4.Text
Instead, use
Weekday(DateValue(Label4.Text))
ThisItem is to access the current Record, which has to do with the underlying data.
Label4 is not a field of a data source, from a previous screenshot you have I think Label4 happens to be a Control that is in the same scope as your Gallery, and I believe also according to that previous screenshot that the formula that you keep trying to put this formula in is another Control that is also in scope of that same Gallery (Ithink it might be Label11) .
Controls that are in same scope as Gallery that are being accessed from another Control in the Gallery, are not accessed through ThisItem.
Controls are just accessed directly in this case.
Just use
Label4.Text
ThisItem.Label4.Text will not work,
but Label4.Text should work.
Check if it helps @s44
Also, I would encourage you follow the guidance that was provided to you by @RandyHayes in recent responses,
I am not sure if you did that.
Do you want the weekday number or the weekday name?
Change the Items property of the gallery to the following:
ForAll(
Sequence(If(DateDiff(varVideoFirstDayView; DateAdd(varVideoMonth; 1; Months); Days)>35; 42; 35));
With({_date: DateAdd(varVideoFirstDayView; Value; Days)};
{Value: Value;
Items: Filter(Fournisseur; DateArrivee <= _date && EndTime >= _date);
_date: _date
}
)
To show the name of the day, set your label text to: Text(ThisItem._date; "dddd")
I hope this is helpful for you.
Another problem, ThisItem is to access the Record of that corresponding data source row for the Gallery, this is for accessing the Data Source fields that are corresponding to that gallery row, not for accessing the other Controls on that Gallery row. The Control is already in-scope of the Gallery, and is not supposed to be accessed by ThisItem, but simply accessed directly instead.
You should not use ThisItem here.
Just access Label4.Text directly instead.
Try
Weekday(DateValue(Label4.Text))
See if it helps @s44
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional