cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nottheOther
Helper II
Helper II

How to extract minutes and hours from Date and TIme Sharepoint column?

Hi,

 

How to extract hours and minutes for "Default" field in Hours and Minutes dropdowns from Date and Time SharePoint column?

 

1. SharePoint column is set to type: "Date and time", also "Include Time" option is set to Yes.

2. For saving I'm using Patch function:

ReqDate: DateE.SelectedDate + Time(Value(HourE.Selected.Value); Value(MinutesE.Selected.Value); 0);

3. For DefaultDate in datepicker this works fine:

LookUp(SPData; ID=eI; ReqDate)

4. Minute and Hour dropdowns are populated with items ["00";"01";...;"23"]

5. I've tried to set "Default" in minutes/hour dropdowns in this way:

Hour(LookUp(SPData; ID=eI; ReqDate))

but this doesn't work.

 

Any ideas what I'm doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
nottheOther
Helper II
Helper II

 

Text(Minute(LookUp(SPData; ID=eI; ReqDate)); "[$-en-US]00")
Text(Hour(LookUp(SPData; ID=eI; ReqDate)); "[$-en-US]00")

 

View solution in original post

2 REPLIES 2
nottheOther
Helper II
Helper II

 

Text(Minute(LookUp(SPData; ID=eI; ReqDate)); "[$-en-US]00")
Text(Hour(LookUp(SPData; ID=eI; ReqDate)); "[$-en-US]00")

 

View solution in original post

DavidJennaway
Solution Supplier
Solution Supplier

I think your problem is that you need to convert the output of the Time function to Text - e.g. 

 

Text(Time(Value(HourE.Selected.Value); Value(MinutesE.Selected.Value); 0)"hh:mm:ss")

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,911)