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 / duplicates being patch...
Power Apps
Unanswered

duplicates being patched to excel

(0) ShareShare
ReportReport
Posted on by 36

HI All,

 

I have an issue where in offline mode my usual patch data is stored in a local collection, the collection is placed into a gallery and i can see whats i need to see in Gallery, however when the sync is completed, when back online, it sends the correct amount of rows but they are first entry on the list.

 

the code when submit is below which i believe works

 

If(
    Connection.Connected, // Check if there's an internet connection
    Patch(
        MasterTest,
        Defaults(MasterTest),
        {
            Trailer: ComboBox1_5.Selected.NewFleetList,
            Comments: TextInput1_6.Text,
            TimeStamp: Now(),
            'User ID': TextInput3_5.Text,
            Latitude: TextInput4_10.Text,
            Longitude: TextInput4_11.Text,
            'Empty Yes / No': ListBox1_5.Selected.Choice,
            Site: Label13_1.Text
        }
    ),
    Collect(
        LocalCollection,  // Create a local collection
        {
            Trailer: ComboBox1_5.Selected.NewFleetList,
            Comments: TextInput1_6.Text,
            TimeStamp: Now(),
            'User ID': TextInput3_5.Text,
            Latitude: TextInput4_10.Text,
            Longitude: TextInput4_11.Text,
            'Empty Yes / No': ListBox1_5.Selected.Choice,
            Site: Label13_1.Text
        }
    )
)
 
 
Then the code for sync is here
 
If(Connection.Connected,
    ForAll(
        Gallery1.AllItems,
        Patch(
            MasterTest,  // Target data source (MasterTest)
            Defaults(MasterTest),
            {
                Trailer: Gallery1.Selected.Trailer,
                Comments: Gallery1.Selected.Comments,
                TimeStamp: Now(),
                'User ID': TextInput3_5.Text,
                Latitude: TextInput4_10.Text,
                Longitude: TextInput4_11.Text,
                'Empty Yes / No': ListBox1_5.Selected.Choice,
                Site: Label13_1.Text
            }
        );

        // Debugging statement to notify that the patch is executed for the current item
        Notify("Debug: Patch executed for item " & Gallery1.Selected.Trailer, NotificationType.Information)
    )
);

Clear(LocalCollection)
 
 
Any help really appreciated. if you need more context please ask
 
Thx
Categories:
I have the same question (0)

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 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard