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 / Is it possible to patc...
Power Apps
Unanswered

Is it possible to patch or create records from a Gallery to SharePoint that have been grouped and summed?

(0) ShareShare
ReportReport
Posted on by 35

Hello friends,

 

I was wondering if it was possible to dynamically patch or store gallery records to a SharePoint list? More context,

 

I have a scoreboard which is grouping by teams and summing up scores. (the records are filtered for the last 90 days).

I have a countdown for the 90-day period, I would like to dynamically patch the winner which is the first record from the top in the gallery to a SharePoint list when the counter reaches 0.

 

Jake_Daniels_9_0-1701932466342.png

How could I achieve this?

 

I'm thinking of using a collection to collect these records, then patch the collection to SP list, however I want this action to only occur once as I don't want every user patching to the SP list. 

 

How can I avoid duplicates? or Make sure this action only happens once regardless of the user. 

Categories:
I have the same question (0)
  • scalca Profile Picture
    on at

    where does your gallery get the data from ? 
    obviously you could add a timer control which OnTimerEnd property patches the first item of the gallery to SP, but as you noticed this would be triggered within each app session. Or if your counter drops to 0 then you could run in the onstart property the patch function get the first item of your gallery using First(gallery.AllItems).

    I think you could apply an if statement to check whether or not an item exists in SP which has "created on"  that day then do not patch, however I would rather take this into a power automate flow using the data source of your gallery and not inside the app itself.

  • Jake_Daniels_9 Profile Picture
    35 on at

    @scalca 

     

    My gallery gets data from an SP list,

     

    I definitely understand and I'm kind of thinking how I can achieve this on Power Automate. 

    What sort of trigger would I use, and how would I get automate to recognize the first record created within the last 90 days. 

     

    Currently, I have this running onvisible of my initial form.

     

    Collect(ColAllGames,'Game Scores');

    ClearCollect(ColAllGamesPatched, First(Gallery1.AllItems));

    Set(myrecord, LookUp('Games Win History', myrecord.ID = ID));

    Patch('Games Win History',
    ForAll(Gallery1_1.AllItems,
    {
    SumofValue: Gallery1_1.Selected.'Sum of Value',
    TeamAliasText: Gallery1_1.Selected.TeamAliasText,
    'Game Played': "All Games"
    }
    )
    );

     

     

    I was thinking I could limit the user ID in an if statement to just myself and manually go on to the app every time the days = 0. This is however not very nice and will be a pita for me. 

     

    Do you have any suggestions for the do not patch with the created-on condition?

  • scalca Profile Picture
    on at

    Using a scheduled flow and then get items based on created on date which is today - 90 days and then get the the one item with highest score.

     

    The other one is add the patch function into an if statement where you check if there is an item in SP list with created on date = today, if true do nothing else add the patch function. 

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard