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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Example of saving seco...
Power Automate
Unanswered

Example of saving seconds in a variable

(0) ShareShare
ReportReport
Posted on by 34

Hello, can someone give me an example of how to save in a variable the real seconds that are passing please, I need it for a project.

 

Thank you very much for your time.

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    @momolopu 

    Are you saying you need the seconds from the current time?

     

    VJR_0-1659604298796.png

     

  • momolopu Profile Picture
    34 on at

    But it would not be to show only the seconds of the current date. It would be a variable that would start from 0 and would increase by 1 for each second that passes.

     

    Thank you very much for your time, you help me a lot.

  • VJR Profile Picture
    7,635 on at

    Not fully sure what you are trying to achieve, but you can use Wait action to wait for 1 second and then increment variable by 1

  • momolopu Profile Picture
    34 on at

    Yes, if I do that and put an execution delay of 1 ms and put it in a loop I increase +1 to the variable every second.

    But is there any way to make it do that without getting stuck in a loop?

    That is to say that it goes counting the seconds while it continues doing other things?

    I don't know if I have explained myself a little strange hehe

  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    I think the only way to achieve this would be to set a variable for start_time in the spot in the bot where you want it to start, and then set another variable for end_time, and then compare

  • LogicSmith Profile Picture
    225 on at

    Yes, Ryule is right. Assuming you want the answer to "how long did this take", the only way is to grab the time into a start time variable, then when you're done, grab the time into an end time variable, subtract the start from the end, and you can do that in seconds, minutes, whatever. I use this exact method to time how long some flows take to write to a log file.

  • VJR Profile Picture
    7,635 on at

    @momolopu, looks like you want to have a continuous running time that will keep on ticking every second WHILE the other PAD actions keep running.

    Something like a DoEvents in VBA...which will continue the events while the program is running.

    Doesn't seem to have a similar feature in PAD...the execution stops until that action is completed. You can play around and see if you can achieve the same.

  • momolopu Profile Picture
    34 on at

    @ryule @LogicSmith If that would be great for me, would you be so kind to give me an example, I am quite new to this program. Thank you very much.

  • LogicSmith Profile Picture
    225 on at

    If you want to know how long something takes, I can provide code for that (3 actions). If you want something to happen every second, Power Automate is not the tool for that. Sorry.

     

  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    ryule_0-1659991810960.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 535

Last 30 days Overall leaderboard