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 show gallery re...
Power Apps
Unanswered

how to show gallery records based on selections

(0) ShareShare
ReportReport
Posted on by

i have SP gallery in powerapps, i want to add star icon in each record to subscribe it as favorite by user. what all the records user subscribe by clicking star should load and this should load every time when user login, each user will have his favorite loaded records. and one more button screen to load All records. how to do this.

Categories:
I have the same question (0)
  • Samuel-Zhou Profile Picture
    393 on at

    @venky232 Hi,You need to set a variable in the selection property of the star icon to save the record selected in the current library and the user's information. When the user logs in, the judgment is made based on the user's identity, so the project property of your gallery is also You need to make a judgment, and then add another button, select the attribute and directly put in the variable in the gallery item to adjust.

  • venky232 Profile Picture
    on at

    how to do this step by step

  • Samuel-Zhou Profile Picture
    393 on at

    @venky232I'll test it, then tell you

  • venky232 Profile Picture
    on at

    any updates?

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @venky232,

    Do you want to load data when the app on start?

     

    Actually, you should save the collection data to local device/web browser and load it when you open the app again.

     

    These functions can now be used when playing an app in a web browser as an experimental feature. This feature is disabled by default. To enable, navigate to Settings > Upcoming features > Experimental > Enabled SaveData, LoadData, ClearData on web player." and turn the switch on. 

     

    Here is a tip for you, you need to create a column to save the user who likes this record.

    In my scenario, I have a subscriber column to save who subscribes this record once someone clicks the star icon.

     

    You just need to add the following formula for the OnSelect property of the star icon:

    Patch(List,ThisItem,{subscriber:User().Email});
    Collect(colSubscribe,ThisItem);
    SaveData(colSubscribe,"LocalSavedItems")

    Then set the OnStart property of the App as below:

    LoadData( colSubscribe, "LocalSavedItems" )

    Set the Items property of the Gallery as:

    Filter(colSubscribe,subscriber=User().Email)

     Then you could add another Gallery by setting following formula to display all the records:

    List
  • venky232 Profile Picture
    on at

    i dont want to save data back to list & it will not have user coloumn also. i want to store in local collection

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @venky232,

    Just do fine tuning to add this column to this temporary collection.

     

    You need to know that you should generate a collection to include this user column at very first(run OnStart of the app, or anyway), then create another collection once you click the star icon.

    This original collection should be like:

    ClearCollect(colSubscribe,AddColumns(list,"subscriber",""))

     

    Then modify the patch formula as below:

    Patch(colSubscribe,ThisItem,{subscriber:User().Email});
    Collect(colSubscribe,ThisItem);
    SaveData(colSubscribe,"LocalSavedItems")

     

    Further, I am not sure if the situation that you could not create a column in your list affects the LoadData() or not when the app on start, you need to test it on your side.

    If it does not work, well, there is no direct way to achieve this if you don't want to change your data source

  • venky232 Profile Picture
    on at

    i added above 2 codes  

    OnStart propertyOnSelect property of the star icon:

    and also turned on expermential feature but nothing working.

    it is not selecting star icon

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @venky232,

    I have mentioned that this feature is supported on mobile app or web player on mobile phone, if you operate it on your computer, I am afraid it is not possible.

     

    Check our official doc for reference:

    SaveData, LoadData, and ClearData functions in Power Apps - Power Platform | Microsoft Learn

  • venky232 Profile Picture
    on at

    then ,how to do for Desktop version

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard