cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DPozzi
Helper II
Helper II

date selection behaviour change when inside an "IF" control

Hi, I've got a strange issue in my date selection input named "DataManutenzione"

 

It's default value was:

 

Concat(
            (SortByColumns(
                Distinct(
                    Filter(
                        Automobili,
                        Title = SelTarga.Selected.Result
                    ),
                    DataManutenzione
                ),
                "Result"
            )),
            Result & ""
        )
 
this collect the date value from a sharepoint list, then if you need it, you can change it clicking on the date box.
For tech requirment a case where the "last date" in sharepoint is empty occurred, so in order to avoid subsequent errors in the triggered flow I've implemented a second default value in that way:
 
If(IsBlank(Concat(
            (SortByColumns(
                Distinct(
                    Filter(
                        Automobili,
                        Title = SelTarga.Selected.Result
                    ),
                    DataManutenzione
                ),
                "Result"
            )),
            Result & ""
        ))
        ,
        varDate                 ####varDate is set in the onvisible tab of the screen as Set(varDate,0)
        ,
        Concat(
            (SortByColumns(
                Distinct(
                    Filter(
                        Automobili,
                        Title = SelTarga.Selected.Result
                    ),
                    DataManutenzione
                ),
                "Result"
            )),
            Result & ""
        ))
 
for unkown reason (at least for me) the same concat/sort/distinc/filter operation that works fine before, when used in the "else" return a totally wrong value (have to be 02/03/2021 and appears 12/31/2001) then in the next screen where a label has default value as: DataManutenzione.SelectedDate it shows nothing, what I'm missing?
5 REPLIES 5
iAm_ManCat
Super User
Super User

No worries, its likely just the date hint (also called InputTextPlaceholder)

12/31/2001 is the InputTextPlaceholder for when the datepicker is blank.

 

Select your datepicker, Go to the advanced tab on the right-hand pane, clear out the formula for InputTextPlaceholder or else set it to something more useful like:
"dd/mm/yyyy"

 

image.png

 

image.png

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


DPozzi
Helper II
Helper II

Probably I've found some sort of bug?

 

If(Value(KmManutenzione_2.Text)=0,varKM,Text(Value(KmManutenzione_2.Text),"#,###" )) this won't format the number with the "," where instead Text(Value(KmManutenzione_2.Text),"#,###" ) works fine!

What's the problem with the IF ???!!

 

So this is a separate issue, and likely not the If statement

 

Is your text input control set to numbers only? You can't convert non-text items to Value

So for example:

"15 000" will not convert

"15000" will convert

image.png

 

Did we solve your issue with the DatePicker?

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


it was set on text, now on number. Anyway issue only occurs when in the if statement otherwise worked fine until now.

No the date picker issue is still there, as soon as I use the if statement it stops to work, the wrong date is the inputtextplaceholder as you suggested so it's not related to the issue.

DPozzi
Helper II
Helper II

About the number I switched back to the "text" and handled the issue otherwise.

About the date I "solved" the issue setting a default date in the sharepoint list column but still I'm confused about the issue

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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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