cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gavinleung
Level 8

Re: Multiple Sharepoint List item by PowerApps or Flow

Hi @shailendra74 

 

I managed to create records into the list, by using this:

ClearCollect(collRecurrence,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]);
Clear(collData);
UpdateContext({FREQUENCY: Switch(rdoFrequency.Selected.Value , "Daily", 1, "Weekly", 7, "Monthly", 30)});
ForAll(collRecurrence, Patch('Standard Work Plan', Defaults('Standard Work Plan'),
{ 'Title': DataCardValue8.Text, 'Assigned To': DataCardValue9.Selected, 'Assignment Date': DateAdd(DataCardValue10.SelectedDate, FREQUENCY) ,'Standard Minutes':Value(DataCardValue11.Text)}))

 

But it comes to another issues:

The Assignment Date of these records is 19/8, and created 31 records. So looks like I forgot to do some calculation on the number of occurences. So in the ForAll loop, any idea to calculate such reoccurecence? 

 

Thanks,
Gavin

 

 

shailendra74
Level 10

Re: Multiple Sharepoint List item by PowerApps or Flow

Hi @gavinleung 

 

 

You need to apply filteron collRecurrence as mentioned in my earlier response:

 

ForAll( Filter(collRecurrence, Value <= Value(txtOccurrences.Text)), Collect(collData, { Row: Value}))

Here collRecurrence is set to a max of 31 (0-30), rest code is based on the count of recurrence and so on.

 

secondly, collect the data in collData, before updating the SP List/Database

 

Thanks.

gavinleung
Level 8

Re: Multiple Sharepoint List item by PowerApps or Flow

Thanks @shailendra74 ! I got it done, and my final code:

 

ClearCollect(collRecurrence,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]);
UpdateContext({FREQUENCY: Switch(Dropdown2.Selected.Value , "Daily", 1, "Weekly", 7, "Monthly", 30)});
ForAll(
Filter(
collRecurrence,
Value < Value(txtOccurences.Text)
),
Patch(
'Standard Work Plan', Defaults('Standard Work Plan'),
{
'Title': DataCardValue7.Text,
'Assigned To': DataCardValue8.Selected,
'Date': DateAdd(DataCardValue9.SelectedDate, FREQUENCY * Value),
'Std Minutes':Value(DataCardValue11.Text)
}
)
);
Navigate(BrowseScreen1)

View solution in original post

shailendra74
Level 10

Re: Multiple Sharepoint List item by PowerApps or Flow

Hi @gavinleung 

 

Cheers!!!!

 

If the previous response helps, then please consider Accept it as the solution to help the other members 

 

Thanks.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,530)