Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to use ‘missing’ date dynamic content in Power Automate expression

Posted on January 6, 2021August 23, 2022 by Tom

“I’m missing the dynamic content with a date when building an expression to formatDateTime(…) in Power Automate. How can I build the expression without it?”‘


Formatting a date in Power Automate flow is one of the commonly used expressions. You just put a dynamic content with a date into a formatDateTime() expression and get a date in the desired format. But how can you use the dynamic content if it’s missing? It’s available when used directly, but once you start typing an expression it’s gone.

power automate missing date dynamic content expression

Add ‘Compose’ action

The simplest solution is to add a ‘Compose’ action with the date in your flow. Add it just before the current action where you want to use the expression. Enter the date as the ‘Compose’ input and then use output from that action in the expression itself. It’s a solution used in the previous post on building approval history.

formatDateTime(outputs('Compose'),'yyyy-MM-dd')
power automate approval flow history

Type in the dynamic content

Another, cleaner but more complicated approach is to ‘type in’ the dynamic content into the expression by yourself. Even if Power Automate doesn’t show it, the data is still there. You just need to type in the ‘dynamic content’ manually into the expression.

As you probably noticed when using dynamic contents in expressions, it’s always a different string. It’s not just ‘Date’, it can be something like ‘items(‘Apply_to_each_2’)?[‘Date’]’. And that’s format of the string you must type in.

Or you take the string directly from the flow. Add a compose action to your flow in the same way as above. But this time, instead of using output from the action you select > copy > paste the dynamic content into a text editor. The string will have format as below.

@{items('Apply_to_each_2')?['Date']}
power automate get dynamic content

As you can see, it’s similar to the string used in the expressions. There’re just 3 characters you must remove: @, { and }.

@{items('Apply_to_each_2')?['Date']} remove @, { and }
=>
items('Apply_to_each_2')?['Date']

And that’s the string you use in the expression. Add the string inside the expression and Power Automate will process it.

formatDateTime(items('Apply_to_each_2')?['Date'],'yyyy-MM-dd')
power automate expression with dynamic content

Once you enter the expression, you can remove the original ‘Compose’ action you used to get the dynamic content string.

Summary

Power Automate is sometimes really user unfriendly. The user interface has all the data, but it just doesn’t want to help you build the expression. But there’s always a workaround. And this time it’s either adding another action to your flow, or doing a bit of ‘coding’ by yourself.

Both the solutions above will achieve the same result: you get access to a ‘missing’ dynamic content. The only situation where the ‘Compose’ solution will not work is in actions using a whole array, e.g. ‘Filter Array’ or ‘Create HTML table’. In all the other flow where you process items one by one it’s up to your preference which solution you use.

Also, the solutions above don’t apply only to dynamic content with dates. You can use the same approach in all situations where the expression doesn’t offer you the dynamic content, e.g. when avoiding corrupted email attachments.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes