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 / Few collection values ...
Power Apps
Answered

Few collection values are not getting stored into the SharePoint List

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am creating an application as shown below in the picture. I am trying to update 'Adjusted Hours' and Comments for multiple rows simultaneously so that the entire data is saved with 1 click. In this case, I am storing all the updated values in a collection and sending the collection values to SharePoint list (after clicking on tick mark). All the values are getting stored in the collection but only few values are getting stored in the SharePoint list. I have checked the code multiple times and tried various things but, still not luck. Can someone please explain me if I am missing anything.

 

ashwinijain932_0-1598239891415.png

 

I used to below code to save all the entries into the collection. 

 

If(

    ThisItem.Job in Collection1.Job1 And ThisItem.WeekEnding in Collection1.WeekEnding1,

    Patch(

        Collection1,

        First(

            Filter(

                Collection1,

                Job1 = ThisItem.Job,

                WeekEnding1 = ThisItem.WeekEnding

                )

            ),

            {AdjustedHours : Value(TextInput5.Text)}

            ),

    Collect(

        Collection1,

        {

            Job1 : ThisItem.Job,

            WeekEnding1 : ThisItem.WeekEnding,

            AdjustedHours : Value(TextInput5.Text)

        }

    )

)

 

And, I used the below code to send the data to SharePoint list.

 

ForAll(

    Collection1,

    Patch(Hours, First(Filter(Hours, Job = Job1, WeekEnding = WeekEnding1)), {'Adjusted Estimate Hours':  AdjustedHours, Comments: Comments1}));

 Navigate(Screen2); Clear(Collection1)

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Regarding the formula that you mentioned, I think there is something logic issue with it. I have made a test on my side, please try to modify your formula as below:

     

    Firstly, you should add the "+" icon inside the Gallery rather than outside the Gallery. Then you could update current Gallery Item and add new entry via pressing the "+" icon. Set the OnSelect property of the "+" icon inside the Gallery to following:

    Patch(
     Collection1,
     LookUp(Collection1,Job1 = ThisItem.Job && WeekEnding1 = ThisItem.WeekEnding),
     {
     AdjustedHours : Value(TextInput5.Text)
     }
    );
    Collect(
     Collection1,
     {
     Job1 : ThisItem.Job,
     WeekEnding1 : ThisItem.WeekEnding,
     AdjustedHours : Value(TextInput5.Text),
     Comments1: "" // you should also include the Comments1 field here when you add a new entry
     }
    )

    Note: I assume that you have initialized the Collection1 already when you load your canvas app. Please do not forget adding the Comments1 field in your Collect formula as above.

     

    You should modify your ForAll formula as below:

    ForAll(
     Collection1 As LoopRecord, // Modify formula here
     Patch(
     Hours,
     If( // Modify formula here. Detect if the collection record is exited in your SP List or not
     IsBlank(LookUp(Hours, Job = LoopRecord.Job1 && WeekEnding = LoopRecord.WeekEnding1)),
     Defaults(Hours),
     LookUp(Hours, Job = LoopRecord.Job1 && WeekEnding = LoopRecord.WeekEnding1)
     ), 
     {
     'Adjusted Estimate Hours': LoopRecord.AdjustedHours, 
     Comments: LoopRecord.Comments1
     }
     )
    );
    Navigate(Screen2);
    Clear(Collection1)

    Please consider try above solution, then check if all collection records has been updated in your SP List.

     

    Regards,

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
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard