web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Overwrite entire colum...
Power Apps
Answered

Overwrite entire columns of table with gallery items

(0) ShareShare
ReportReport
Posted on by 294

Hi,

I have gallery that contains two columns, one for process steps, and the other is their sequence numbers. I'd like to overwrite the entire columns of an existing table (same structure), with the entire contents of this gallery. How can I do that?

I'm only using CDS and no external lists (e.g. SP, etc.). I'm looking for a solution that does not require using external data sources. Many thanks!

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    Overwrite gives an indication of replacing the data in the Gallery. To get the structure of the Table use ClearCollect;

    ClearCollect (ColOverwrite, Datasource);

    Clear (ColOverwrite)

     

    That gives an empty structure. Now what do you want to put into the Table structure

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • karimabdelrazek Profile Picture
    294 on at

    @eka24 . Sorry if the message wasn't clear. I want to take all the items in the gallery, and write it into an existing CDS entity/ table that contains data.

  • Verified answer
    eka24 Profile Picture
    20,923 on at

    You can Patch the Gallery or the Collection using following;

    Gallery:
    ForAll(Gallery1.AllItems, Patch(
    Datasource,
    Defaults(Datasource),
    {Column1: Title},
    {Column2: Category}))

     

    For a collection;

    ForAll(Collection1,
    Patch(Datasource, Defaults(Datasource), {Column1: Title,
    Column2: Category}))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • karimabdelrazek Profile Picture
    294 on at

    @eka24 . The formula you gave partially works. It writes all the data to the correct columns in my entity, but instead of overwriting, it's adding them as records. Is there a way to overwrite the data in the entity?

  • karimabdelrazek Profile Picture
    294 on at

    @eka I've found the answer. I removed all the values from that entity using the "Remove" function, and re-wrote all the values from gallery into it.

    Thanks for your help!

  • v-bofeng-msft Profile Picture
    on at

    Hi @karimabdelrazek :

    Is your problem solved? Do you still need help?

    If you have found a solution, could you mark it as a solution so that more people can see it.

    Best Regards,

    Bof

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 372 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 303 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 238 Super User 2026 Season 1

Last 30 days Overall leaderboard