cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
E_B
New Member

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 @E_B ,

 

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.

View solution in original post

2 REPLIES 2
Ramole
Memorable Member
Memorable Member

@E_B 

 

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 please consider Accept it as the solution to help the others and consider giving it a "Thumbs Up."
v-jefferni
Community Support
Community Support

Hi @E_B ,

 

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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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