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 / Patch function for who...
Power Apps
Answered

Patch function for whole collection

(0) ShareShare
ReportReport
Posted on by 145

Hello,

i have a problem with Patch(source,collection)

 

This is my SQL datasource

Flashback_1-1684416291506.png

And this is my command for collection in PowerApps

 

ClearCollect(
colRunSource1,
ForAll(
Table(ParseJSON(OdataLOADER.Run(TextInput3.Text).vystup).body),
{
SampleLabel: Concatenate(Text(Value.WO),Text(Value.Sample)),
Method: Text(Value.Method),
Run: Value(TextInput3.Text),
Valid: true,
WaterVolume:"",
PCEVolume:"",
Remarks:"",
ClientCode:Value.ClientCode,
PreparedBy:"",
OldRecord:"",
NewRecord:"",
ID:""
}
)
);
// vlož číslo řádku v runu ke vzorkům a přidej sloupečky pro poznámky //
ClearCollect(
colSamplesForExport5,AddColumns(
ForAll(
Sequence(CountRows(colRunSource1)),
Patch(
Last(FirstN(colRunSource1, Value)),
{RowNumberInRun: Value}
)
)

 

Here you can see example with entered values

 

Flashback_3-1684416695177.png

 

 

But i still cannot save whole collection by Patch

Flashback_2-1684416623541.png

 

I have same columns with same names...

 

Could anybody help me please?

BR

jakub

Categories:
  • Verified answer
    timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    @Flashback 

    What are you intending to do here? If you want to add a new record for each row in your collection into your SQL table, the correct function here is Collect.

    Collect(
     Fitr_Sample,
     colSamplesForExport5
    )
  • Flashback Profile Picture
    145 on at

    Wow, it work great!

     

    What is different between Patch(source,collection) and Collect(source,collection) ??

     

    Till today i think that correct formula is Patch....

     

    Amazing is that with collect formula i see exactly which columns make problem and why 🙂

     

    Really thanks

    Jakub

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard