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 / Converting String to D...
Power Automate
Answered

Converting String to Date (Year Only)

(0) ShareShare
ReportReport
Posted on by 87

Hello.

 

I am currently trying to find workarounds on converting the String value I fetch from a Combo Box (contains years only) in Power Apps (using PowerApps V2). There is an error that appears whenever I try to convert the string with the code int(formatDateTime(triggerBody()['text_2'],'yyyy')) in Get Items. Is there a way or another method at least filter items in a SharePoint List by Year only? Hoping this will be noticed. Thanks in advance

Screenshot for reference of the error:

almapete21_0-1659598699703.png

 

Categories:
  • MarconettiMarco Profile Picture
    3,812 Super User 2024 Season 1 on at

    Hello @almapete21 ,

    would you please share the flow in Edit mode?

     

    BR,

    Marco

  • almapete21 Profile Picture
    87 on at

    Hi, Marco.

     

    Here is the screenshot when the flow is in Edit Mode:

    almapete21_0-1659602434174.png

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @almapete21 Share SP list column TransactionDate column. I want to see what kind of date it is getting from List. Do one this remove Transactiondate from filter and run your flow then check output of get items and see Transaction Date column value.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Can you send the formatdatetime in edit mode please ? 

  • almapete21 Profile Picture
    87 on at

    Hi, Hardesh.

     

    This is the output if TransactionDate is removed from the filter.

    almapete21_0-1659603564654.png

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @almapete21 See here you are getting full date and you are expecting get items will return result based on Year. How?

    Tell me if you want to get result from get items based on Year?

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • almapete21 Profile Picture
    87 on at

    Please tell me how to get results based on year from Get Items. 

  • almapete21 Profile Picture
    87 on at

    Hi, MehdiB,

     

    this is the formatdatetime code: int(formatDateTime(triggerBody()['text_2'],'yyyy'))

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @almapete21  Pls use filter array action after Get items (do not include transaction date in filter query). In Filter array you can apply condition .

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @almapete21  Here is the example-

    Hardesh15_0-1659605255093.png

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard