cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

Dropdown Items property Date formatting issue

Scenario:

- Dropdown control

- Items property set to:

 

 

SortByColumns(
    AddColumns(
        Distinct(
            colAllRecords,
                PLN_STRT_DT
        ),
        "planStartDateFormatted",
        Text(Result, "[$-en-US]mm-dd-yyyy") //<---Formatting not being respected
    ), 
    "planStartDateFormatted", 
    Ascending
)

 

 

- Original PLN_STRT_DT is in ISO8601 datetime format ("2020-01-01T00:00:00Z")

- I'm trying to show a more user friendly format using ("01/01/2020")

- But the formatting is not being reflected in the Dropdown control

 

ericonline_0-1610732218112.png

- Clearly seen here as well:

ericonline_0-1610732377508.png

 

What am I missing?


Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@ericonline 

Looks like it is seeing it as text.

Try the following:

SortByColumns(
    AddColumns(
        Distinct(
            colAllRecords,
                PLN_STRT_DT
        ),
        "planStartDateFormatted",
        Text(DateTimeValue(Result), "[$-en-US]mm-dd-yyyy") //<---Formatting not being respected
    ), 
    "planStartDateFormatted", 
    Ascending
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@ericonline 

Looks like it is seeing it as text.

Try the following:

SortByColumns(
    AddColumns(
        Distinct(
            colAllRecords,
                PLN_STRT_DT
        ),
        "planStartDateFormatted",
        Text(DateTimeValue(Result), "[$-en-US]mm-dd-yyyy") //<---Formatting not being respected
    ), 
    "planStartDateFormatted", 
    Ascending
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

ericonline
Community Champion
Community Champion

That worked!

(Wrapping my head around this):

- So we converted the Text-type column to DateTimeValue, then back to Text.

- The interim step there allowed PowerApps to apply the formatting.

- Yeah, that makes sense to me.

- Another trick up the sleeve for future apps. 

Thanks again!

ericonline_0-1610734519442.png

 

RandyHayes
Super User
Super User

@ericonline 

Yep, you got it.  Since the date was in ISO time, we needed to let PowerApps turn it into its date type, then we could format it with the standard text function.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,864)