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 III
Super User III

@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

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@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

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 III
Super User III

@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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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