cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Truncating attachment name

Hello,

 


I am trying to create a workflow that does the following:

 

  • Monitor Gmail mailbox for messages with attachments.
  • If there is an email with an attachment, the attachment is saved in Google Drive with the filename being #[EstimatedSize][last 30 characters of the filename including file type]
  • Record the results in a Google Sheet


I've figured out everything except the last 30 characters part. 

 


I'm not a programmer or experienced with SQL but I tried using substring('Name',0,30) to see if I could get some series of output but get the error below when I run it. 

 


Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '19413': 'The template language function 'substring' parameters are out of range: 'start index' and 'length' must be non-negative integers and their sum must be no larger than the length of the string.


Any assistance would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Truncating attachment name

Hi @tamesh 

 

You need to use the expression tab to enter the expression 

Capture.PNG

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Truncating attachment name

Hi @tamesh 

 

Please see this post by AlanPs1 

 

https://powerusers.microsoft.com/t5/Building-Flows/Solved-Extract-last-n-characters-from-Form-input/...

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Regular Visitor

Re: Truncating attachment name

Hi abm,

 

Thanks for responding. I feel I may be missing something. Attached is a screenshot of my flow. With what I entered, my output is what I have highlighted. For the first input I put 'Name' for the attachment name field.

 

msflow.png

Highlighted
Dual Super User II
Dual Super User II

Re: Truncating attachment name

Hi @tamesh 

 

You need to use the expression tab to enter the expression 

Capture.PNG

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Highlighted
Regular Visitor

Re: Truncating attachment name

(facepalm) Thank you, that did the trick!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,207)