Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Timesheet

(0) ShareShare
ReportReport
Posted on by 395

Hi, working on a timesheet app. I have a start and finish time dropdown and a AM/PM drop down box. I have a hidden label that i want to show army time of what the user selected. On the text properties of the hidden lablel, i can put in the below and it works fine.

If(MonFinish.Selected.Value="12:15"&MonAMPM.Selected.Value,"AM","1215")

But i need to be able to convert all times selected. If i put in the hidden label text properties, see below, i get an error. I have tried Or and && but only shows true and false in the label instead of the time e.g. 1215

If(MonFinish.Selected.Value="12:15"&MonAMPM.Selected.Value,"AM","1215");

If(MonFinish.Selected.Value="12:30"&MonAMPM.Selected.Value,"AM","1230")

Can you please assist

Categories:
  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Timesheet

    Hi @Matt383 ,

    It can be done with a bit of complexity if I knew your AM/PM rules and the conversion result.

  • Matt383 Profile Picture
    Matt383 395 on at
    Re: Timesheet

    Hi Warren, yes i did try both && and Or but both result in the label saying false. It works fine if i only have one line. e.g. Substitute( MonStart.Selected.Value, "12:15", "1215") 

     

    Matt383_0-1634613884711.png

     

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Timesheet

    Hi @Matt383 ,

    Firstly you need && instead of &, but there may be an easier way depending on what your rules for AM/PM are  - the below will get the format

    Substitute(
     MonFinish.Selected.Value,
     ":",
     ""
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard