cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Save data to sharepoint list from dynamic collection gallery

Hello,

 

I have an app that have two input text boxes (one single, second multi) that are placed in gallery.

This gallery data source is a collection that allows users to dynamically add more positions, but I need to allow users to save this data to Sharepoint list.

 

I need to allow to save this data to Sharepoint list and view it in gallery (best would be same gallery that was this collection...)

How would you accomplish that?

 

Functions:

Screen OnVisible:

If(CountRows(colNumberedGUIDS) = 0,ClearCollect(colNumberedGUIDS, GUID() ))

Gallery items:

colNumberedGUIDS

Add task:

Collect( colNumberedGUIDS, GUID())

Delete task:

Remove(colNumberedGUIDS,Last(colNumberedGUIDS))

 

I managed to create a simple Patch function but it does not work well.

 

Patch (Obrazy_obecnosc, Defaults (Obrazy_obecnosc), {Nazwa_zadania:Zadanie_nazwa.Text},{Opis_zadania:Zadanie_opis})

 

When I click it it create a new record, and it is only patching last item.

Sometimes in gallery there are 10 items. I do not know where to patch gallery2...

 

I tried this but it doesn't work (invalid use of '')

ForAll(Gallery2.AllItems,
    UpdateIf(
        Obrazy_obecnosc, ID = Value('Identyfikator (ID)'.Text),
        {Nazwa_zadania: Nazwa_zadania.Text, Opis_zadania: Opis_zadania.Text}
    )
)

This still won't allow users to view theirs records since collection will be cleared...

2 REPLIES 2
Wayne_A
Advocate III
Advocate III

 

YOU'RE IN LUCK!

The awesome @mdevaney  posted a blog about this just the other day! Go check out https://matthewdevaney.com/power-apps-patch-function-examples-for-every-sharepoint-column-type/

 

That's the most that I could work out:

 

Patch(
Obrazy_obecnosc,
LookUp(Obrazy_obecnosc, Created = Today() & 'Imię i nazwisko'.Email = User().Email)
{
Nazwa_zadania:Zadanie_nazwa.Text,Opis_zadania:Zadanie_opis.Text
}
)

But it has troubles cannot evaluate formula because of incompatible type (=)

 

But it does not update good record, it creates a new one.
Also it only save ONE tile with data but there are a lot of tiles. How to save them all?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,001)