cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brucla1968
Helper II
Helper II

Change the visualization format of a Number field to Date

Hello. I am new of PowerApps and developing a simple canvas form, to select and show data from an excel file source on onedrive business.

I have a field which is meant to be a date, but in original datasource results as a number. No matter, I do not need to change its format at origine, I just need to visualize it as a date on PowerApps form.

Here how the field (DtStartSoc) appears in the app and also the data type (Parent.Default), where I see only two options,  String or Number (no date option).

 

04.PNG

Here in the screen of app, and also 

 

01.PNG

02.PNG

 

Here field format. I tried to write "dd/mm/yy" instead of TextFormat.Number but nothing changed. I also tried to use Text function as Text(ThisItem.DtStartSoc, "dd/mm/yy", language()) but I got an error and I do not know if this is the right way.

 

03.PNG

 

Thanks for help 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Brucla1968 ,

You need to store your date in Excel as Text dd/mm/yyyy and then display it as DateValue(TextFieldName) and then if necessary, write it back using Text(YourDate,"dd/mm/yyyy").

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @Brucla1968 ,

You need to store your date in Excel as Text dd/mm/yyyy and then display it as DateValue(TextFieldName) and then if necessary, write it back using Text(YourDate,"dd/mm/yyyy").

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

timl
Super User
Super User

@Brucla1968 

That's an Excel serial number that you have there.

If you just want to display that on your form, I have a post here that describes how to do the conversion.

http://powerappsguide.com/blog/post/convert-excel-date-serial-numbers

 

 

DateAdd(Date(1900,1,1),
    ThisItem.DtStartSoc -2 ,
    Days
)

Hi @WarrenBelz . I updated format in source excel file and refreshed datasource in PowerApps. Just after I got this error in MaxLength parameter. How could I fix it? 

01.PNG

 

When you write to display field as DateValue(TextFieldName)  you mean to write it in parameter DisplayMode ?

 

02.PNG

Thanks

Thanks @timl  but I tried to write DateAdd function in parameters Format and DisplayMode of my field settings but I got in both cases errors. Where should I input this function?

Brucla1968
Helper II
Helper II

I deleted the field and re-added it, after having changed format in origine (excel file). Now it works. Thanks

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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