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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,597)