web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Change time if checkbo...
Power Automate
Unanswered

Change time if checkbox = true

(0) ShareShare
ReportReport
Posted on by 160

Hi,

 

i got a flow where employees can request an absence. They add the data of their absence in a Sharepoint List, which is the trigger of my flow.

Now, i got a problem with the input time in the Sharepoint List

wshalex123_3-1664441294689.png

 

If you keep the time at 00:00 in Start & Ende, it shows up the wrong date in the calendar later on.

 

wshalex123_2-1664441260840.png

 

 

My Goal:

 

So i added a checkbox, where the user can select, if the absence is a whole-day absence (= In the picture above "Abwesenheit Ganztägig?") (like in outlook)

 

In my flow i want:

 

If

"whole-day absence" = Yes

Then

change the time of "Start" to 00:00 and of "Ende" to 24:00 (No matter which time the user selected!)

 

I only want to change the time, not the date!

 

I haven't found any action in power automate which fits my wish...

 

Maybe someone can help me out 🙂

 

Thanks a lot!

 

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    Hi @wshalex123 

     

    Try the below expressions

     

    formatDateTime(utcNow(),'dd-MM-yyyy 00:00')
    formatDateTime(utcNow(),'dd-MM-yyyy 24:00')
     
    Change the UTCNow() to your Dynamic datetime.
  • wshalex123 Profile Picture
    160 on at

    Hey @abm ,

     

    So you also know a solution, where you change the time in a variable in order to use it with the rest of the flow? 

     

    wshalex123_0-1664445089133.png

     

    Like here, where i changed the timezone of the created item in the sharepoint list, i need a action where i change the time itself, not a formula.

  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    Hi @wshalex123 

     

    Try the below

     

    image.png

  • wshalex123 Profile Picture
    160 on at

    Hey @abm,

     

    you solution works, but i got a problem when adding this time to ,the sharepoint calendar because of the format...

     

    wshalex123_0-1664457797164.png


    How can i change the type so i can use it as string and date?

     

     

     

  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    What the datatype in SharePoint? If its string then use string() expression to convert the value.

  • Verified answer
    wshalex123 Profile Picture
    160 on at

    For future visitors: here's the solution:

     

    FYI:

    Timezones are absolutly strange here, and until today i have to idea why exactly this certain timezone works for me (i have different timezones in my actions), i just tried so many different timezones until i got the correct time.

     

    here's the flow with notes (i changed names of the action partially):

     

    wshalex123_0-1666165429165.png

    • "Convert timezone"
    • create a custom date, with "." as delimiter.
      • if you type: dd, MM, YYY, hh, mm, ss, am or pm, you will get the data from the sharepoint list
      • 00.00.00."am" is my overriten or custom manipulation of the date 

    wshalex123_1-1666165694918.png

    "initialize variable"

     

    1: Change data type of the "custom date"

    2: Split up the "custom date"

    • formula:
    • split(variables('VarDateInString'), '.')
    • ... '.' is the delimiter you put in the custom date in the first step

    3: Combine the date again

    • formula:
    • formatDateTime(concat(variables('VarDate')[6], ' ',variables('VarDate')[3], ':',variables('VarDate')[4], ':', variables('VarDate')[3], ' ', variables('VarDate')[2], '-', variables('VarDate')[1], '-', variables('VarDate')[0]), 'MM/dd/yyyy hh:mm:ss tt')
    • ... ' ' , ':' , '-' are the symboles between the variables (choose correctly!) -> dd-MM-yyy HH:mm tt
    • variables('VarDate')[6], variables('VarDate')[5], etc. is the data between the delimiter (dd, MM, etc)
      • the order i the opposite from the date's order! So 'VarDate')[6] = "am" and VarDate')[0] is MM
      • I changed the position of MM and dd here, which makes absolutly no sense, but i got the correct result
     
    Hard to explain this topic, it cost me hours.
    But maybe i can help someone with this
     
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard