cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ersula82
Level: Powered On

Patch true toggle values in a gallery back to Sharepoint

I've created an app that will allow parents to checkin tardy students. They enter a number to pull up a gallery list of their kids which is filtering from a sharepoint list to another screen. I have a toggle inside of the gallery and a submit button outside of the gallery. I would like the submit button to patch only the records in the gallery that have a true toggle value to a sharepoint list called "Visitors". Previously I had a checkin button inside of the gallery instead of the toggle but decided to go with the toggle instead. The button patched everything I needed but was not functional for my purpose. The button's formula was as follows:

 

If(Reasons_DD.Selected.Value = "Other", Patch(Visitors, Defaults(Visitors), {Title:ThisItem.Title,Checkin_x0020_DateTime:Now(),Reasons: Other_Txtbox.Text}),Patch(Visitors, Defaults(Visitors),{Title:ThisItem.Title,Checkin_x0020_DateTime:Now(),Reasons: Reasons_DD.Selected.Value}))

 

So, I need to still accomplish the steps in the above formula because I need to make sure that the following gets patched:

1. the Reasons_DD.Selected.Value for the selected gallery item that has a true toggle

2. Checkin_x0020_DateTime:Now() for the selected gallery item that has a true toggle

3. If the "Other" value is selected from the dropdown box, I need the Other_Txtbox.Text to patch for the selected gallery item that has a true toggle

 

Please help!

Capture_toggle.PNG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ersula82
Level: Powered On

Re: Patch true toggle values in a gallery back to Sharepoint

Hi @v-monli-msft,

I found my solution to the problem so I'm posting so maybe it can be of use to someone else. I have a new problem which relates to this but I'll post in a new post so it can be separate.

 

Thank you!

 

The solution to my problem was: 

ForAll(Gallery1.AllItems,
If(Toggle1.Value= true,
If(Reasons_DD.Selected.Value="Other",
Patch(Visitors,Defaults(Visitors),{Title:Title,Checkin_x0020_DateTime:Now(),ReasonsSmiley Surprisedther_Txtbox.Text}),
Patch(Visitors,Defaults(Visitors),{Title:Title,Checkin_x0020_DateTime:Now(),Reasons:Reasons_DD.Selected.Value}))))
2 REPLIES 2
Community Support Team
Community Support Team

Re: Patch true toggle values in a gallery back to Sharepoint

Hi @ersula82,

 

Please tell the column types of the fields Reasons_DD/Checkin DateTime(is it date or date and time column?)/Other. 

 

Patching different kinds of column types need different syntax. For example, patching choice column the synax should be something like:

Patch(
    MyList,
    Defaults(MyList),
    {MyChoiceColumn:
        {
        Value: Dropdown1.Selected.Value,
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}
        }
    )

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ersula82
Level: Powered On

Re: Patch true toggle values in a gallery back to Sharepoint

Hi @v-monli-msft,

I found my solution to the problem so I'm posting so maybe it can be of use to someone else. I have a new problem which relates to this but I'll post in a new post so it can be separate.

 

Thank you!

 

The solution to my problem was: 

ForAll(Gallery1.AllItems,
If(Toggle1.Value= true,
If(Reasons_DD.Selected.Value="Other",
Patch(Visitors,Defaults(Visitors),{Title:Title,Checkin_x0020_DateTime:Now(),ReasonsSmiley Surprisedther_Txtbox.Text}),
Patch(Visitors,Defaults(Visitors),{Title:Title,Checkin_x0020_DateTime:Now(),Reasons:Reasons_DD.Selected.Value}))))