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 Automate / How to include a colum...
Power Automate
Suggested Answer

How to include a column in CSV which is not in SharePoint list, but available in Gallery

(1) ShareShare
ReportReport
Posted on by 144
I am generating CSV file from PowerApps on clicking of a button. I have a column called Final Amount  which is available in Gallery but not in SharePoint list.
 
Is there a way we can export this column in csv file? May i know how to do so?
 
Gallery - Final Amount Text property
Sum(
    Filter(
        Items,
        Title = ThisItem.'Serial Number'
    ),
    Amount
)
 
Export to CSV Button OnSelect
ClearCollect(
    MyCol1,
    Gallery1.AllItems
);
Set(
    vardroppedcol,
    DropColumns(
        MyCol1,
        Image1,
        Image1_1,
        Thumbnail,
        Button2,
        Button2_1,
        ID,
        Icon2
    )
);
Set(
    varFormattedJSON,
    JSON(
        vardroppedcol,
        JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
    )
);
Launch(UAT_GiftEnt_GenerateCSV.Run(varFormattedJSON).link);
 
Power Automate to generate CSV
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,849 Super User 2026 Season 2 on at
    Gallery.AllItems does not include calculated controls. Use AddColumns() to append the calculated FinalAmount column before converting the collection to JSON and generating the CSV.
     
    Instead, create a new collection that includes all the SharePoint fields you need plus a calculated Final Amount column.
     
    For example:
    ClearCollect(
        MyCol1,
        AddColumns(
            Gallery1.AllItems,
            FinalAmount,
            Sum(
                Filter(
                    Items,
                    Title = ThisRecord.'Serial Number'
                ),
                Amount
            )
        )
    );
     
    Then continue with your existing logic:
    Set(
        vardroppedcol,
        DropColumns(
            MyCol1,
            Image1,
            Image1_1,
            Thumbnail,
            Button2,
            Button2_1,
            ID,
            Icon2
        )
    );
    Set(
        varFormattedJSON,
        JSON(
            vardroppedcol,
            JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
        )
    );
    Launch(UAT_GiftEnt_GenerateCSV.Run(varFormattedJSON).link);
     
  • Suggested answer
    Haque Profile Picture
    4,004 Super User 2026 Season 2 on at
    Hi @Poweruser32490,
     
    You can do it in two steps-
     
    1. Considering your gallyer is Gallery1 and on its OnSelect create a collection with gallery's current items plus calcualated column:
    ClearCollect(
        ExportCollection,
        AddColumns(
            Gallery1.AllItems,
            "FinalAmount", ThisRecord.FinalAmount
        )
    );
    
     
    2. Genereate the CSV from ExportCollection instead of directly from SP.
     
    Note: 
     
    AllItems – Items that are loaded in the gallery. This may be less than the actual number of Items of the data source. More items may be loaded when the gallery is scrolled. AllItems also contains controls that are used in each gallery item.
     
  • Poweruser32490 Profile Picture
    144 on at
    Hi @11manish,
     
    I tried your code, but it throws below error. May i know why?
     
    Instead of ThisRecord.Declaration_No, if i put Gallery label i.e. Label6.Text or substitute actual Declaration_No, it works fine. 
     
     
  • Suggested answer
    MS.Ragavendar Profile Picture
    7,613 Super User 2026 Season 2 on at
     
    ClearCollect(
        MyCol1,
        AddColumns(
            Gallery1.AllItems As GalRec,
            FinalValuatedAmount,
            Sum(
                Filter(
                    Items,
                    Declaration_No = GalRec.Declaration_No
                ),
                Amount
            )
        )
    );
    
    Set(
        vardroppedcol,
        DropColumns(
            MyCol1,
            Image1,
            Image1_1,
            Thumbnail,
            Button2,
            Button2_1,
            ID,
            Icon2
        )
    );
    
    Set(
        varFormattedJSON,
        JSON(
            vardroppedcol,
            JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes
        )
    );
    
    Launch(UAT_GiftEnt_GenerateCSV.Run(varFormattedJSON).link);
    ✅If this helped, please Accept as Solution to help others ❤️ A Like is appreciated 🏷️ Tag @MS.Ragavendar for follow-ups.

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 Automate

#1
David_MA Profile Picture

David_MA 306 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 169 Super User 2026 Season 2

#3
Haque Profile Picture

Haque 131 Super User 2026 Season 2

Last 30 days Overall leaderboard