Skip to content

How to format date column in DetailsList? #120

Answered by scottdurow
kthirapatpibul asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kthirapatpibul,
You can use AddColumns. E.g.

  1. Edit the Items property to include an additional column that formats your date:
AddColumns(
Accounts,
"ColDate",
Text('createdon',"yyyy-mm")
)
  1. Add the new date column to the Fields property by clicking on Items
  2. Update your columns definition to display the 'ColDate' property - but set the ColSortBy property to the original date so that you can sort by the real date field.
  3. If you were using automatic sorting - you will now need to change to use manual sorting as described by https://learn.microsoft.com/en-us/power-platform/guidance/creator-kit/detailslist#manual-sorting

Hope this helps!

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@craigyh
Comment options

Answer selected by denise-msft
Comment options

You must be logged in to vote
8 replies
@yaseralhosani
Comment options

@knyklu
Comment options

@yaseralhosani
Comment options

@knyklu
Comment options

@yaseralhosani
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants