cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Create SharePoint list item from attachment, removing file extension

Hi,

 

I've created a flow to create a SharePoint list item when an email arrives. I would like the title field to be the attachment filename without the extension.

 

I've searched but been unable to find the right code to strip the extension from the file name.

 

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

You could get the name without extension of the attachment by using the function provided by Expression.

Formula reference:

 

replace(items('Apply_to_each')['Name'],concat('.',last(split(items('Apply_to_each')['Name'],'.'))),'')

Flow configuration:

17.PNG

Output result:

18.PNG

Please take a try.

 

Best Regards,

Barry

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

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

You could get the name without extension of the attachment by using the function provided by Expression.

Formula reference:

 

replace(items('Apply_to_each')['Name'],concat('.',last(split(items('Apply_to_each')['Name'],'.'))),'')

Flow configuration:

17.PNG

Output result:

18.PNG

Please take a try.

 

Best Regards,

Barry

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

Hi - that worked great. Apologies for the delay in coming back to you - the reply notification ended up in my spam folder.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,168)