cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kilaj1
Helper I
Helper I

SharePoint Date field showing up as String in PowerApps

I may just need to do a bit more "youtubing" and "googling", but from what I can see it should be working as is.  I have a SharePoint list with a date and time column. 

kilaj1_0-1611268480124.png

 

I add the Form control to the power app canvas and connect to the SharePoint list, the date input shows up as a text box and the data type is string. 

kilaj1_1-1611268518618.png

 

I've tried creating a new column in the same list and its the same result.  I created a brand new list with just a single Date field that that works.  The list that isn't working was created using the Import from spread sheet option originally, there are over 90 fields, didn't want to create them manually.  Could this be the cause? is there something else I can do to link it to a PowerApp Date control?

4 REPLIES 4
WarrenBelz
Super User III
Super User III

@kilaj1 ,

A text box will always hold a string, whether it be Text, Date or Numeric. In the case of a date, it will display the field in the data source, but if you want to refer to it as a date, you need to use DateValue(TextBoxName)

 

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.

 

kilaj1
Helper I
Helper I

Thanks for the response, I actually figured it out after retracing my steps.  I created a table in excel and I used the "Add app" function in SPO.  For some reason when its imported its set to a number field, even if i change it in the list after the fact or even create a new column it would not pull the correct column type over into PowerApps.

 

I then poked around in the Site contents area of SPO and saw the "New"> "List"  option

kilaj1_0-1611326800491.png

This allowed me to specify the column types before creating the list.

 

I recreated the excel file and tried pre-formatting some of the columns, had mix results. In one case it created the list but still changed everything to a number field. Another case it it had a JSON error and didn't create the list. another an general error but it did create the list but missed about 15 columns.

 

What it came down to I think was the "Title" data type being changed from default, which was the first column in my list.  I left it with a Type of "Title", and proceeded to update the other fields and the list created with no issues, then in PowerApps it pulled in the correct controls.

Thanks @kilaj1 ,

This is another reason you should watch this video from Shane Young @Shanescows .

 

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.

kilaj1
Helper I
Helper I

Funny you mentioned @Shanescows , I've been using his videos for most if not all of my PowerApps learning. Its the reason I'm using SharePoint List now vs what I was doing before, hardcoding everything in the app.  

 

I I think I figured things out (although its mentioned a bit in that video you linked), this was more of a Excel to SPO/powerapps "issue" than anything.  When I used the import from excel function it created the columns all as numbers as mentioned before.  I think that the columns got registered (locked in) as that data type behind the scenes, I tried recreating the column with the same name and it didn't work. when I created a new column with a different name with a date data type it worked.

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (36,475)