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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (49,198)