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

Truncating attachment names pt.2

Hi,

 

A few weeks ago @abm and @RezaDorrani helped me to come up with my process so that if a filename of an attachment that is being saved to google drive is over 30 characters, I can truncate it to a max of 30 characters. When I implemented this, I discovered that it worked great for anything over 30 characters but processed nothing for under 30 characters. The less than 30 characters processing would just be the attachment being saved in the google drive folder without any change to the filename. I'm trying to figure out how to satisfy these two conditions. Would I need to create a condition? The screenshot attached shows the expressions for >30 characters.

 

Thanks in advance.

truncate30.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @tamesh ,

 

Please refer to screenshot below to create the flow:

1.png2.png

 

The expression in the Condition as below:

length(outputs('AttachmentName'))

And keep the expression in the totChar input and last30 input.

 

Please let me know if your problem could be solved.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

5 REPLIES 5
Highlighted
Super User III
Super User III

Hi @tamesh 

 

Could you please post your flow screenshot? Need to see your current conditions and logic.

 

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

Hi @tamesh 

 

just create a condition and use the length function in an expression

 

length(name of attachment) greater than 30

- then truncate 

- else continue as is

 

Regards,

Reza Dorrani

 

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

 

Highlighted
Community Support
Community Support

Hi @tamesh ,

 

You could add a Condition under the "AttachmentName" action check if the outputs('AttachmentName') is over 30 characters, Inseide the if yes branch, do your following two actions truncate the name, and inside the if no branch, just get the whole name.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Regular Visitor

Hi @abm ,

 

Attached is my current flow

workflow.png

 

totChar input expression is: sub(length(outputs('AttachmentName')),30)

last30 input expression is: substring(outputs('AttachmentName'), int(outputs('totChar')), 30)

Highlighted

Hi @tamesh ,

 

Please refer to screenshot below to create the flow:

1.png2.png

 

The expression in the Condition as below:

length(outputs('AttachmentName'))

And keep the expression in the totChar input and last30 input.

 

Please let me know if your problem could be solved.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

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.

Top Solution Authors
Top Kudoed Authors
Users online (13,865)