cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Eelman
Level 10

Re: powerapps forall

@SimonDu88 

No worries, happy to help.

 

Yes, this is doable, it just becomes a little math problem - with some added on screen logic. The logic I would use is make users pick a certain day of the week to make the math easier eg Monday (you can pick Sunday or another day if you like but I'll work on Monday here).

 

So, user selects a Monday and the record inside your Patch gets updated to:

Patch(ABC, Defaults(ABC),
// add a Monday record
{RecurrenceDateDaily: DateAdd(DateValue3.SelectedDate, ((Value-1) * 7), Days)},

// add a Thursday record
{RecurrenceDateDaily: DateAdd(DateValue3.SelectedDate, ((Value-1)*7) + 3, Days)}

)

You can use the same ForAll() structure and same counter you setup before.

 

To check if a user has picked a Monday, put this is a label somewhere (oh, and also Disable/Enable your Save button depending on if a Monday has been chosen or not):

If(Weekday(DateValue3.SelectedDate)<>2,
    "Please chosen a Monday date. You cannot Save your data",
    "Your data is ready to Save")

Note: Weekday() returns a number from 1-7, Sunday=1 ,  Monday=2 ...

 

 

 

View solution in original post

SimonDu88
Level: Powered On

Re: powerapps forall

many thanks for your advice and much appreciated.

How would I go about creating a collection weeks?

Would it be similiar to the collection for DateRange - Date, Day, value but instead WeekRange - Date, Week, value? (where Week is Mon, Tues,......etc?

Your help would be much appreciated.

Eelman
Level 10

Re: powerapps forall

@SimonDu88 I'm a little unsure of what you are wanting to do here. Could you provide an example?

 

If it's just a Week vs a Date range, yes you should be able to do it you have set-out. What have you tried?

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,708)