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

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

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

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (8,937)