cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tamesh
Level: Powered On

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
Dual Super User
Dual Super User

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
Super User
Super User

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!



tamesh
Level: Powered On

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

Dual Super User
Dual Super User

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

tamesh
Level: Powered On

Re: Truncating attachment name

(facepalm) Thank you, that did the trick!

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,299)