cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hemasai1999
Helper III
Helper III

Formula to patch checked items in gallery to sharepoint

Hi,

I have  two date pickers one for start date and other for end date when I select start date and end date and click on add button range of particular dates will be displayed in gallery, in gallery I have check box only selected items in gallery (i.e if checkbox = true) then if I click on check icon it should get stored in to SharePoint.This is my app where default option for checkbox will be trueThis is my app where default option for checkbox will be true

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Hemasai1999 ,
Syntax structure below - you have only mentioned on field to add

ForAll(
   Filter(
      YourGalleryName.AllItems,
      YourCheckBoxName.Value
   ) As aPatch,
   Patch(
      YourSharePointList,
      Defaults(YourSharePointList),
      {YourSPDateField:aPatch.YourGalleryDateField}
   )
)

 

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.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @Hemasai1999 ,
Syntax structure below - you have only mentioned on field to add

ForAll(
   Filter(
      YourGalleryName.AllItems,
      YourCheckBoxName.Value
   ) As aPatch,
   Patch(
      YourSharePointList,
      Defaults(YourSharePointList),
      {YourSPDateField:aPatch.YourGalleryDateField}
   )
)

 

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.

Hemasai1999
Helper III
Helper III

Hi @WarrenBelz ,

This formula is working fine to patch all the checked items in gallery but when I want to patch start time and end time separately for each date then it is storing same start time and end time for all dates in SharePoint. In formula Label10_4 is my start time and Label 10_5 is my end time 

This is my galleryThis is my galleryThis is my sharepointThis is my sharepointThis is formula which I have used to store in sharepointThis is formula which I have used to store in sharepoint

Hi @Hemasai1999 ,

What is the name of the control that you have the date in, is the field name it refers to Title (this is Text, not a date) and what is the Items of your gallery?

Hi @WarrenBelz ,

Items for my gallery is DateRange which is collection that I have in my formula .

My issue is : I have start time and end time for each date when I edit start time and end time then it should store separately for separate dates. Instead If I edit for one date then It is updating same start time and end time for all dates

In my app I have one icon that is eye icon in that icon I have written formula as below picture , this formula is to basically select all dates from start date to end date and display in galleryIn my app I have one icon that is eye icon in that icon I have written formula as below picture , this formula is to basically select all dates from start date to end date and display in galleryThis is formulaThis is formula

@Hemasai1999 ,

It would have been good to post that piece of code at initially in your post. Can you please re-post in text and explain a bit exactly what you are trying to achieve with it.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (4,084)