Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Prc5GEKSqJddwxPXsFX8Im
Power Automate - General Discussion
Answered

How to initialize Date Type variable

Like (2) ShareShare
ReportReport
Posted on 9 Apr 2018 12:44:15 by

There is no "Date Type" when creating/initilizing variables. Is there any way to work with Date types(adding, subtracting time from existing dates in the lists)?

  • hiteshn Profile Picture
    61 on 30 Oct 2020 at 16:12:14
    Re: How to initialize Date Type variable

    Hi,

     

    There is not any such variable type that can be used for the dates in power automate, it can be stored in string type. Instead of this I used Compose action and just stored the date in value.

    Using this original format type is reserved and does not need any conversions ahead.

     

    To further work with updates such as adding, subtracting, etc. we can directly save these actions in compose variable or if already saved, 'Outputs' from compose action can be used.

  • Community Power Platform Member Profile Picture
    on 10 Apr 2018 at 15:02:59
    Re: How to initialize Date Type variable

    Thanks for the response and the link!

    🙂

  • Verified answer
    vecerpa Profile Picture
    786 on 10 Apr 2018 at 07:44:08
    Re: How to initialize Date Type variable

    Hi @Anonymous,

    Yes in link I posted there is Azure Logic Apps - https://docs.microsoft.com/cs-cz/azure/logic-apps/logic-apps-workflow-definition-language

    Flow is based on Azure Logic Apps, so there is possible to find description of functions that are used.

    P.

  • Community Power Platform Member Profile Picture
    on 09 Apr 2018 at 14:39:43
    Re: How to initialize Date Type variable

    Thanks so much for your help! Your screenshots with comments were very helpful.

    Is there any source for learning syntax used in the expressions? For example, using variables or field values inside addDate() expression was not something that I could have seen in internet or Flow documentations. 

    Thanks!

  • vecerpa Profile Picture
    786 on 09 Apr 2018 at 14:12:00
    Re: How to initialize Date Type variable

    And there is also a set of Date Time actions that I forgot...

     

    DateTime3.PNG

     

    🙂

    P.

  • Verified answer
    vecerpa Profile Picture
    786 on 09 Apr 2018 at 14:02:27
    Re: How to initialize Date Type variable

    Hi @Anonymous,

     

    Yes it is possible to work with datetime from list, for example below I used created on item of sharepoint list.

     

    DateTime1.PNGDateTime2.PNG

    Just use string type and then you are open to use datetime functions - https://docs.microsoft.com/cs-cz/azure/logic-apps/logic-apps-workflow-definition-language.

     

    There s like adddays(), formatdatetime(), addhours(), addminutes()...

    Hope this helped a bit

    P.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started
Loading complete