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.
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.
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
}
)
)
)
)
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.
@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.
User | Count |
---|---|
254 | |
107 | |
92 | |
48 | |
37 |