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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (106,017)