cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Defaults() for SharePoint list does not return anything for DateTime field if it is set to "Today's date"

I hope this is the right place to report bugs, if not, let me know where to go, but as the title says, Defaults() is broken.

 

As this other topic also shows, it's broken in more than one way, but it is acutely broken when referencing a "Date and time" type field where the default value is set to "Today's date" - it is simply not returned whatsoever. Put a "Date and time" field in a SharePoint list, set it to a Default value of "Today's date", and it will not show up even if it's explicitly referenced by Defaults('List').Field. It does work with a fixed date.

 

I suspect, but I am not willing to test, that this will probably affect default values which are similarly dynamic, i.e. calculated.

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to below doc:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-defaults

 

Note: Data sources vary in how much default information they provide, including not providing any at all. When you work with a collection or another data source that doesn't support default values, the Defaults function will return an empty record.

 

Apparently Date and time column default value is not supported to be retrieved into PowerApps. But I'm more wondering why you want to get the default value that in a SP list? In the doc you could see Defaults() basically use along with Patch function.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
Ramole
Super User
Super User

@Anonymous 

 

When saying Defaults() not return anything for DateTime, where did you put todays date? is it Date Picker 

CaptureDatePicker.PNG

 

Please explain more how do you save the data etc. screenshot will be helpful  

Thank you
If this post helps, then Click on the Thumbs Up below. and Accept it as the solution . to help others find helpful.
v-jefferni
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to below doc:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-defaults

 

Note: Data sources vary in how much default information they provide, including not providing any at all. When you work with a collection or another data source that doesn't support default values, the Defaults function will return an empty record.

 

Apparently Date and time column default value is not supported to be retrieved into PowerApps. But I'm more wondering why you want to get the default value that in a SP list? In the doc you could see Defaults() basically use along with Patch function.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,678)