Skip to main content

Notifications

Community site session details
Power Automate - General Discussion
Answered

remove last element from array

Like (2) ShareShare
ReportReport
Posted on 30 Jul 2021 13:37:03 by 48

Hi 

 

I'm having an array like this ["a","b","c","d","e"] now i want to remove last 2 elements from array. is there any possibility to do so ?

  • Verified answer
    JuanPJesusG Profile Picture
    47 on 01 Aug 2021 at 18:49:13
    Re: remove last element from array

    Hi,

     

    You can use this function 

    take(outputs('Compose'),add(length(outputs('Compose')),-2))
     
    JuanPJesusG_0-1627843668791.pngJuanPJesusG_1-1627843687024.png

    Best regards,

    JP

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - General Discussion

Overall leaderboard
Loading started
Loading started