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 / InvalidTemplate substring
Power Automate
Unanswered

InvalidTemplate substring

(0) ShareShare
ReportReport
Posted on by 14

Hi Everyone,

 

I was following this video https://www.youtube.com/watch?v=95sPDky0bU0&t=21s to export my filtered gallery to CSV file. Unfortunately I'm having this error. 

SeanEli_0-1658564439545.png

 

I'm not very familiar with composing the expression but from the video, it's supposed to delete the extra and on the outputs.

 

Hope anyone help please.

Categories:
I have the same question (0)
  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    Please share the expression you are using

  • SeanEli Profile Picture
    14 on at

    Hi,

    SeanEli_0-1658566632266.png

    I got it from the video

    if(endsWith(outputs('Compose'),' And '), substring(outputs('Compose'),sub(length(outputs('Compose')),5), length(outputs('Compose'))), outputs('Compose'))

  • AS-06081019-0 Profile Picture
    1,736 Super User 2024 Season 1 on at

    I believe the third parameter is causing an issue. Substring takes in 3 parameters:

    1. Source string - the original piece of text
    2. Start index - the index/position where you want to start extracting from
    3. Length - the number of characters you want to extract (from the start index)

    An example is below:
    orange
    substring('orange', 1, 3) would return ora
    substring('orange', 2, 3) would return ran

     

    Check your length parameter isn't set to 27 if your start index is greater than 1 because it will try to extract past the end of your text .

     

    Try using this link :https://onlinestringtools.com/extract-substring to put in your values and test it out.

     

    Hope it helps!!

    Cheers,
    Ankesh
    --------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • SeanEli Profile Picture
    14 on at

    Hi @Ankesh_49 ,

     

    Thanks for your reply.. This is the expression on the Compose action, based on the video. The variables here are filters on my PowerApps gallery.

    concat(if(not(equals(variables('Cluster'),'All')), concat('Cluster eq ''', variables('Cluster') ,''' and '),''),
    if(not(equals(variables('Group'),'All')), concat('Group eq ''', variables('Group') ,''' and '),''),
    if(not(equals(variables('Status'),'All')), concat('Status eq ''', variables('Status') ,''' and '),''),
    if(not(equals(variables('Reporting Time'),'All')), concat('Reporting Time eq ''', variables('Reporting Time') ,''''),''))

    Say I only used the Cluster filter, this will be the output. It varies depending on the filters I used.

    SeanEli_0-1658619061708.png

    If I understand it correctly, the source string also changes.. Can you help me please how to express that?

     

    Thank you

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 58

#2
David_MA Profile Picture

David_MA 53 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 36 Most Valuable Professional

Last 30 days Overall leaderboard