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 / How to export Gallery ...
Power Apps
Answered

How to export Gallery items to a JSON file?

(0) ShareShare
ReportReport
Posted on by 26

I have a Gallery that displays Outlook Calender events. Each row shows the subject, start date, end date and venue of the event.

 

gallery.png

 

How can all these Gallery items be exported into a single JSON file?

 

For another use case, I was able to read values from individual controls into a dataCollection and save them to a JSONData variable as JSON formatted data.

ClearCollect( dataCollection,
{ Type: Dropdown1.Selected.Value,
DateFrom: DatePicker1.SelectedDate,
DateTo: DatePicker2.SelectedDate,
Duration: Radio1.Selected.Value
});

Set(JSONData,JSON(dataCollection, IndentFour));

 

As for the Gallery, it has a Selected property for individual items. It does have an AllItems property but there was an error when I tried to save it to a variable or collection. 

 

How can I extract the Gallery items into one JSON file?

Categories:
I have the same question (0)
  • Akser Profile Picture
    1,546 Moderator on at

    Hi @taiping8,

     

    I'm sharing a video with a timestamp, any chance you get the error shown there? If yes, continue watching for a possible solution (JSONFormat.IgnoreUnsupportedTypes)

     

    https://youtu.be/tQCBWMR7T64?t=1145 

  • Verified answer
    taiping8 Profile Picture
    26 on at

    I would like to share on the solution. The gallery contains a title, sub-title, label and body.

     

    First is to loop through the gallery items and save them to a collection:

    ClearCollect(
    colEventData, //Collection
    ForAll(
    Gallery1.AllItems As Items, //the Gallery
    {
    Type: "CalendarEvent",
    Subject: Items.Title2.Text,
    Start: Items.Subtitle3.Text,
    End: Items.Label11.Text,
    Venue: Items.Body1.Text
    }
    )
    );

     

    Then save the collection to a variable.

    Set(jsonEventData,JSON(colEventData, JSONFormat.IndentFour));

     

    Finally run the Power Automate flow to write the contents to a file:

    CalFlow.Run(jsonEventData);

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard