cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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

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

 

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (12,968)