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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If blank and if not bl...
Power Apps
Answered

If blank and if not blank functions for date picker

(0) ShareShare
ReportReport
Posted on by 101

I have 3 fields.  Field 1 is a date picker labeled Submit Date.   Field 2 is a text input labeled Calendar Days.  Field 3 is a date picker labeled Due Date.

 

I need help figuring out and IF function.  When calendar days are entered into field 2, I want field 3 to populate the amount of days added to the added to the Submit button.  However, when the Calendar Days field is blank, I would like to populate the Submit date.

 

 If field2 is not blank, add the value of field2 to field1 (submit date) or if field2 is blank show the value in field1

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MicroMarc365 - assuming you're using an Edit Form control, apply the below to the Update property of the DataCard for the Due Date field (Field 3).

     

    If(
     Value('Your Calendar Days Input Control'.Text) = 0,
     'Your Submit Date DataCard Name'.Update,
     DateAdd(
     'Your Due Date People Picker'.SelectedDate,
     Value('Your Calendar Days Input Control'.Text),
     TimeUnit.Days
     )
    )

     

     

     

  • MicroMarc365 Profile Picture
    101 on at

    Hi, 

    I'm using this on a New Form control (Default mode: New)

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @MicroMarc365 - "Edit Form" control:

     

    Amik_0-1707264414553.png

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @MicroMarc365,

    Here is the thing, we only have a form control named EditForm with three modes like New, Edit, View.

    Generally, we use NewForm(FormName), EditForm(FormName),ViewForm(FormName) to change the form mode, however we will leave the form mode as Edit by default.

     

    In a word, I don't suggest you set the default mode as New, I suggest you use a button to change the form mode by setting the Button OnSelect property as:

    NewForm(FormName);Navigate(FormName)

     

    Then based on your needs, please set the DefaultDate property of the datepicker corresponding field3 as below: 

    If(IsBlank(TextInput_field2.Text),DatePicker_field1.SelectedDate,DateAdd(DatePicker_field1,Value(TextInput_field2.Text),TimeUnit.Days))

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard