web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with formula for ...
Power Apps
Answered

Help with formula for recurring appts based on a selected day of week

(0) ShareShare
ReportReport
Posted on by 550

Hello - I'm stuck on one line in a formula to create recurring appointments to a SharePoint calendar based on a selection of the day of week. The formula logic is from the YouTube video: https://www.youtube.com/watch?v=yGvehOu-oZ8

 

When I used the date from a date picker, the formula worked, but when I use the same formula with my date variable based on the day of week, I am getting wonky results. 

 

Below are snippets. Any help is greatly appreciated!

 

OnVisible property of the screen sets date variables for the current week:

kky1_0-1668104520114.png

 

User Interface:

User selects a day from gallery - it then offers user ability to select start and end times. 

kky1_0-1668103117981.png

 

Test label of the Sunday variable:

kky1_1-1668104601067.png

Variables look correct:

kky1_0-1668104740202.png

 

Step 1 of the OnSelect property of my button is to Switch the value from the gallery selection of a day name to an actual date using the date variables above and save as variable varweekday. The ultimate goal is to gather all the available times into a collection and then do one patch to a SharePoint list. 

kky1_0-1668109533831.png

Test of the variable is correct after I selected Wednesday and it is stored as a date:

kky1_1-1668109562323.png

 

Step2 of my button: 

In a ForAll loop calculated with number of weeks in the time frame start and time frame end date pickers to create a collection of appointments. The part of the formula marked with an arrow is returning incorrect results. (The same formula worked when using a date from a date picker.)

kky1_2-1668109644475.png

 

The Collection that is created. Note the WeekDate field is not correct and is blank is some instances.

kky1_7-1668103687472.png

 

Any help on what I'm doing wrong would be sincerely appreciated! Thank you in advance!

 

Categories:
  • Verified answer
    kky1 Profile Picture
    550 on at

    Okay, I figured it out. (Took me much longer than a super user but I guess that's how we learn 🙂 I'm posting the solution in case it is helpful to anyone else who is interested in creating a recurring weekly schedule. 

     

    For the Step 2 of my button above to add the selected day and times to a collection (Collection1), I tweaked the formula to:

    WeekDate: DateAdd(DateValue(varweekday), ThisRecord.Value * 7)

    kky1_0-1668110564414.png

    And now the dates are appearing as I want in my collection:

    kky1_2-1668110619640.png

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard