Skip to main content

Notifications

Power Automate - General Discussion
Answered

PowerFx Left/Right not working on string

(0) ShareShare
ReportReport
Posted on by 76

Hi there,

 

I have a date in this format, 20220824

 

I am trying to convert to a date like 24-08-2022.  I can't format as a date as its not valid, so I was trying to split it into dd, MM, yyyy so I can then concat with '-' to get 24-08-2022.

 

Split doesn't seem to let me choose the amount of characters to count. 

 

Left and right I get the error

 

Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template function 'left' is not defined or not valid.'. 

 

I am trying 

 

Left('20220823',4)

Left(20220823,4)

 

Is there a better way of doing this please?

  • NeonThunder Profile Picture
    NeonThunder 76 on at
    Re: PowerFx Left/Right not working on string

    Thanks 🙂 

  • Verified answer
    Expiscornovus Profile Picture
    Expiscornovus 31,139 on at
    Re: PowerFx Left/Right not working on string

    Hi @NeonThunder,

     

    Below is a list of all the string functions available:

    https://docs.microsoft.com/en-gb/azure/logic-apps/workflow-definition-language-functions-reference#string-functions

     

    In your setup I would use the substring function.

    substring('<text>', <startIndex>, <length>)

     

    Try:

     

     

    substring('20220823',0,4)

     

     

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard