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).
Here in the screen of app, and also
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.
Thanks for help 🙂
Solved! Go to Solution.
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
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
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?
When you write to display field as DateValue(TextFieldName) you mean to write it in parameter DisplayMode ?
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?
I deleted the field and re-added it, after having changed format in origine (excel file). Now it works. Thanks
User | Count |
---|---|
262 | |
110 | |
92 | |
55 | |
41 |