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 / How to view items (log...
Power Apps
Unanswered

How to view items (logical problem)

(0) ShareShare
ReportReport
Posted on by 909

Hello,

 

I need some know-how, cause I have a huge problem in making my app logically correct.

 

I have a gallery with collection as data source. In this gallery I created inputboxes that you can input data in. Creating new gallery item - add new input fields that can be filled (commend collect).

When user finish adding all data he patch it to Sharepoint list.

 

This work on paper brilliantly, but the problem is that I want users to view this data from gallery anytime they want, and also modify it.

My app is for PC also so collection is dumped each log off.

 

I have no idea how to show this gallery with collection after app is reloaded. It is just empty.

My users can save data 24/7 and this patching to Sharepoint is just a step, cause at the end of the data each person has to click close session that patch once more and block adding new entries.

 

Is there a way to reload collection with data from Sharepoint list?

Or should I delete this gallery with collection and gallery with sharepoint list?

 

But how will I add new tasks to this gallery. In collection I use Collect and new item just appears...

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Elitezone 

    IMHO, you should use the datasource as the Items property of a gallery unless there is a good reason to use a collection.  A collection exists in RAM memory but when the session ends it disappears. Moreover, if something happens before the user saves the data, they have to start it all over again.  This does not happen if you patch each item to the datasource as it is entered.     

  • Elitezone Profile Picture
    909 on at

    @Drrickryp 

    I use collection cause I can use gallery in a dynamic way.

     

    Gallery with collection as a data source has one item by default and if I click collect it add a new entry. I can delete gallery dynamically too.

    It is possible to do something like that with a sharepoint list as a data source?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Elitezone 

    Yes you can.  Powerapps works similar to Excel in that changes are reflected as soon as the data is entered successfully.  Galleries update automatically and calculations are executed once the data changes. 

  • Elitezone Profile Picture
    909 on at

    @Drrickryp 

    This is flawed. Because my gallery starts without record inputboxes will not be visible... I need at least one record to view them.

    With Collection I used Collect in onVisible and first record was added. Like here. It won't... My gallery is always empty and I can't add records.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Elitezone 

    I see, you are using the gallery as a way to input data.  This is similar to how MS Infopath worked.  Shane Young (@Shanescows )has a three part series on exactly this topic.  https://www.youtube.com/watch?v=xgznk4XlPCo  I believe that you will find a good way to do what you want to.

  • Elitezone Profile Picture
    909 on at

     But first you told me to drop using collection and now you send me a link to a tutorial that uses collection to do this.

    So confusing.

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @Elitezone ,

    @Drrickryp has given you some sound advice and can only respond to your requirements as you relate them in the particular comment. I will give you another idea here, but it is syntax/structure guidance and you will need to understand the concept to implement it.

    Firstly, do this at App OnStart 

    Set(varUserMail,User().Email)

    Then create a new list in SharePoint with all the columns (same names and types) as the Collection as well as an additional one called UserMail - I have called the List StoreList below - you can call it whatever you want.

    At App OnStart after the code above get the contents of the list that belong to the user

    ClearCollect(
     CollectionName,
     Filter(
     StoreList,
     UserMail=varUserMail
     )
    )

    Now (this is actually the first bit to make it work) when you want to save this before the user exits - you will have to decide where to run this - update the contents of the user's collection, firstly by removing existing records and then adding the collection to it as new records.

    RemoveIf(
     StoreList,
     UserMail=varUserMail
    );
    Collect(StoreList,CollectionName)

    One small thing you will need to do is if the user adds a new record to the collection (you did not specify this), the field UserMail will need to be populated with varUserMail value.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard