web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can date picker value ...
Power Apps
Unanswered

Can date picker value be set to null? Working with is date blank

(0) ShareShare
ReportReport
Posted on by 150

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 propertyOne attempt at the toggle propertyDatePicker has to tie to item 'SERVICE DATE COMPLETE"DatePicker has to tie to item 'SERVICE DATE COMPLETE"

 

Any help is appreciated - because I am stuck

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @DublinOH_User 

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard