powerapps forall

I am using the SharePoint List as a database with a title DateStart. When a user enter a number to represent a number of days (eg: 3), I would like to create 3 date records with a starting date based on today. (DateStart (dd/mm/yyyy) should be 6/12/2020, 7/12/2020, 8/2/2020. I have try to the ForAll function and Patch function, and managed to create the datestart 3x times but with the same date 6/12/2020. How do you use the increment in the ForAll loop so the date increase?

Re: powerapps forall

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).

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Re: powerapps forall

I would like to add a counter in the ForAll loop so the date will be different. using DateAdd() function will only created the same date being created (eg:. the number of days = 3, the date should be "6/12/2020, 7/12/2020, 8/2/2020" but instead the date 6/12/2020 has been repeatedly created 3x times.

could you please advise on how to create incremental inside using the forall function?

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Re: powerapps forall

Please see my code as below, I managed to patch the recurrence date "RecurrenceDateDaily" based on the number of days "DataCardValue1.Text".

(For example: if DataCardValue1.Text = 3, then my RecurrenceDateDaily will be 10/2/2020, 11/2/2020, 12/2/202, based on the date "DateValue3.SelectedDate" = today's date. However, I got 10/2/2020,10/2/2020,10/2/2020. As you can see the date does not increment.) - Please advice, thanks. Today is the deadline for my project.

Re: powerapps forall

May I allow myself to make a great announcement about you. YOU'RE SUPER GENIUS!

IT WORKS! HOORAY.

Thank you so much for your quick response.

if I want to do the same thing for the weekly, I would assume i should create another collection for weekly?

The situation is that user would also like to put the number of weeks (eg: 5 weeks, but every Monday and Thursday for 5 weeks). Would the concept be the same? How would you go about doing the date as this is not every day?