web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Invalid Template

(0) ShareShare
ReportReport
Posted on by 505

Hello i have an interesting error i cant wrap my head around. I am trying to Add an Attachement to my sharepoint list throught a pen input in powerapps. Below is my error message.

 

Unable to process template language expressions in action 'File_Content' inputs at line '1' and column '7316': 'The template language expression 'dataUriToBinary(split(item(),'|')[1])' cannot be evaluated because array index '1' is outside bounds (0, 0) of array.

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,183 Most Valuable Professional on at

    Hi @niklasjegg,

     

    A split function will return an array. In your expression you are trying to retrieve the second item/part of that split array. However, the error suggests that the array has a range of 0,0. So, I guess it can't find your | character in one of the items and has no split result.

     

    As an example I could reproduce this same error with the expression below. Hope that makes sense?

     

    split('Lets split some text', '|')[1]

     

     

    My suggestion would be to first check if the item actually contains a | character before you start using it for a split function. You can use indexof, equals and if functions for this.

     

    Edit: forgot to add examples 😅

     

    When | character is present

    if(equals(indexOf('Lets split | some text', '|'), -1), 'Do Nothing', split('Lets split | some text', '|')[1])

     

    When | character is not present

    if(equals(indexOf('Lets split some text', '|'), -1), 'Do Nothing', split('Lets split some text', '|')[1])

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard