Hi,
I created a calendar and would like a user to select a date range to add time to a SharePoint list.
Would I need to create a collection to get the range?? I'm not sure how to capture the date range.
This is the Items code of the galleryCalendar:
//calculates both the current day and the next day
ForAll(
Sequence(42),
{Value: varFirstDayofMonth + Value - 1 - Weekday(
varFirstDayofMonth,
StartOfWeek.Sunday
) + 1,
NextDay: varFirstDayofMonth + Value - 1 - Weekday(
varFirstDayofMonth,
StartOfWeek.Sunday
) + 2}
)
This is OnSelect code in the gallery:
Set(
varFirstDayofMonth,
Date(
Year(ThisItem.Value),
Month(ThisItem.Value),
1
)
);
Solved! Go to Solution.
Hi @TB05 ,
Could you please check if you have posted the proper formula that OnSelect of the gallery?
Anyway, if you would like to create data range in the calendar, you can set a variable or a collection with a single record that includes two columns: StartDate and EndDate. With the help of IsBlank() function, you could make the app automatedly know into which column the user want to fill the clicked date:
If(
IsBlank(varDateRange.StartDate) || (!IsBlank(varDateRange.StartDate) && !IsBlank(varDateRange.EndDate)),
Set(varDateRange, {StartDate: Date(Year(ThisItem.Value),Month(ThisItem.Value),1), EndDate: Blank()}),
IsBlank(varDateRange.EndDate),
Set(varDateRange, {EndDate: Date(Year(ThisItem.Value),Month(ThisItem.Value),1)})
)
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hi @TB05 ,
Could you please check if you have posted the proper formula that OnSelect of the gallery?
Anyway, if you would like to create data range in the calendar, you can set a variable or a collection with a single record that includes two columns: StartDate and EndDate. With the help of IsBlank() function, you could make the app automatedly know into which column the user want to fill the clicked date:
If(
IsBlank(varDateRange.StartDate) || (!IsBlank(varDateRange.StartDate) && !IsBlank(varDateRange.EndDate)),
Set(varDateRange, {StartDate: Date(Year(ThisItem.Value),Month(ThisItem.Value),1), EndDate: Blank()}),
IsBlank(varDateRange.EndDate),
Set(varDateRange, {EndDate: Date(Year(ThisItem.Value),Month(ThisItem.Value),1)})
)
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Thank you for your post, sorry of my late response. I have been away.
I can't seem to get the date picker calendar to work using the one calendar.
Thank you for your time.
I think I may have more luck trying to use two date pickers.
I create two date pickers: daterangepicker1 and daterangepicker2.
On select, I have the following:
ClearCollect(
DateRange,
AddColumns(
FirstN(
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],
DateDiff(daterangepicker1.SelectedDate, daterangepicker2.SelectedDate, Days) + 1),
"Day",
"Day " & (Value + 1),
"Date",
DateAdd(daterangepicker1.SelectedDate, Value, Days)
)
)
So, I created a gallery so that I could see the dates in the collection and I have them all. Now, I would like to update a SharePoint list with the individual dates in the collection.
When a user selects the range, then enters their time into a field, I would like the time to be Patched for each date in the collection.
If I select, Dec 26 - Dec 31, I have 6 separate days to enter into a SharePoint list with the employees ID, time value and date. I would think that I would have to use a ForAll function to loop through.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
164 | |
94 | |
64 | |
62 | |
60 |
User | Count |
---|---|
243 | |
163 | |
94 | |
84 | |
82 |