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

Add new gallery record

Hello,

 

Is it possible to add new blank gallery record to a gallery that has sharepoint list as a data source?

 

I have a gallery that has two input boxes. I want to allow to people to add more records.

5 REPLIES 5
timl
Super User
Super User

Hi @Elitezone 

Assuming that the two fields that you want to enter are not mandatory in SharePoint, I guess you could call the Patch function to add a new record to the SharePoint list. This would then appear in your gallery, and the end user can then fill in the empty 2 fields.

WarrenBelz
Super User
Super User

Hi @Elitezone ,

Just use

Patch(
   YourSPListName,
   Defaults(YourSPListName)
)

and it will add a new blank record to the List (and to the gallery).

 

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.

But my Gallery Items is:

 

 

 

Filter(
   Obrazy_obecnosc,
   Last(
      Split('Imię i nazwisko'.Claims,"|")
   ).Result = 
   Lower(User().Email) && 
   DateValue(Text(Utworzony)) = Today()
)

 

Using what you provided does not change gallery.

 

And this is my final patch:

ForAll(Gallery2.AllItems,
    With({record: LookUp(Obrazy_obecnosc, Lower('Imię i nazwisko'.Email) = Lower(User().Email) && Text(Created, ShortDate) = Text(Today(), ShortDate))},
        If(!IsBlank(record),
            Patch(Obrazy_obecnosc,
                record,
                {
                    Nazwa_zadania: Zadanie_nazwa.Text,
                    Opis_zadania: Zadanie_opis.Text
                }
            )
        )
    )    
)    

 

Drrickryp
Super User
Super User

Hi @Elitezone 

Keep in mind that SharePoint will always add an ID to a record regardless of whether it is blank as long as none of the other fields are required.  Once the blank record is entered, it is no longer considered a new record and anything that is changed in that record is considered an "Edit" rather than a "New" addition.  To save edited data to an exisiting record, the Patch will need to reflect that in  it's second element.  ie.,

Patch(SPlist, ID=ThisItem.ID, {... . 
Patch(SPlist, Defaults(SPlist), {...  appends a new record to the data source.

@Elitezone ,

@Drrickryp is correct here and you asked a simple question, therefore all I could do was provide an answer based on what you posted. 

You have been a regular poster here for some time - please take the time to read this blog of mine regarding what is generally needed to quickly and accurately get the solution you require.

 

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,527)