
Announcements
Hello,
I have a gallery set up like a repeating table. Meaning editable form field in each item.
Attempting to set up something like this example: April Dunham - Edit Tables
Trying accomplish using the toggle to filter against.
TOGGLE = true when either the comment text or date picker are not blank
TOGGLR = false when both the comment text or date picker are blank
Both SharePoint columns are blank in the list by default
Comments is a multiline TextInput
SERVICE DATE COMPLETE is a DatePicker
with Default property ThisItem.SERVICE DATE COMPLETE,
and InputHint has nothing in the formula
In the end I am trying to accomplish this:
ForAll(Filter(GalleryName.AllItems,Toggle.Vlaue=true),
Patch(TableName,
ThisRecord,{Comments:TextInput_Comments.Text, SERVICE DATE COMPLETE:DatePicker5.SelectedDate}))
Toggle Default property I have tried but did not work: I know these need ot be placed in an Or statement, but they don't function on their own
ThisItem.Comments<>TextInput_Comments.Text
ThisItem.SERVICE DATE COMPLETE<>DatePicker.SelectedDate
ThisItem.SERVICE DATE COMPLETE<>IsBlank(DatePicker.SelectedDate)
One attempt at the toggle property
DatePicker has to tie to item 'SERVICE DATE COMPLETE"
Any help is appreciated - because I am stuck
Are you stating that you want the toggle to be off if the selected date is empty?
I assume you are using a toggle to indicate a changed or valid record in order to update your list.
Is so, the formula on the Default for the Toggle should be:
((ThisItem.Comments <> TextInput_Comments.Text) &&
!(IsBlank(TextInput_Comments.Text))
) ||
((ThisItem.'SERVICE DATE COMPLETE' <> DatePicker.SelectedDate) &&
!(IsBlank(DatePicker.SelectedDate))
)
This will set the toggle to true if the Comments are not the same as the original and the comments input are not blank OR if the date is not the same and the selected date is not blank.
I am not entirely sure if that logic is what you want, but the And's and the Or's can be altered to give you exactly what you are looking for.
Your final "accomplish this" should be:
Patch(TableName,
ForAll(Filter(GalleryName.AllItems,Toggle.Value) As _item,
{ID: _item.ID,
Comments: _item.TextInput_Comments.Text,
'SERVICE DATE COMPLETE': _item.DatePicker5.SelectedDate
}
)
)
Your previous formula was producing a table that was then wasted. ForAll produces a table and should be used as such, not as a For/Loop statement.
I hope this is helpful for you.