Jul 25 2022 12:43 AM
Hi,
I have many file in Document Library and have a template of the name like picture below
and I would like to split '2501686' store in another field (ex. id_number) in the same Document Library.
Do you guy have any solution to suggest me?
Jul 25 2022 05:51 AM
@pexperzen Do you have this fixed file format? number_text OR number<space>text?
If yes, you can create a power automate flow (on file creation/update OR scheduled flow). In flow, split the file name based on _ or <space>, then update the another column using "Update file properties" action with the value you get from split operation.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Jul 25 2022 05:54 AM
It's difficult to answer without more context, so I'll make some assumptions.
1. You are looking for a SharePoint direct solution, not as part of PowerApps or Power Automate, or custom JavaScript.
2. The format of your filename is always the same. i.e., a 7 digit number, then a space, then text.
Using the assumptions above, you can use a calculated column with the following formula:
=LEFT([Name],7)
If the number of digits varies, but is always followed by a space, you can use
=LEFT([Name],FIND([NAME," ")-1)
Calculated columns are great, but can be limiting. If you need a more robust solution, Power Automate has lots of options that Calculated Columns do not.
Here are a couple of links to help you with Calculated Columns.
https://sharepoint-tools.github.io/formulas.html
Good luck,
Don Kirkham
Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Jul 26 2022 11:49 PM
Thank you @Don Kirkham for your kindly.
I do follow your suggestion but the output is 0. ( in filename_ma)
I have no idea what's my mistake. T^T
Jul 27 2022 04:15 AM
Jul 28 2022 12:09 AM
Solution@pexperzen If you are using SharePoint online, you can use Power automate flow to update the column in library based on file name.
You can configure your flow something like this:
ID and Name in second action are dynamic data from first trigger in flow.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Aug 01 2022 10:05 PM
@Don Kirkham Thank you for your suggestion. I applied your answer with @ganeshsanap suggestion. 1. Create new columns filename_ma type Single line of Text and personal_no type Calculate Column and formula is =LEFT([filename_ma],7)
2. Create Power Automate Flow follow @ganeshsanap suggestion and this is a result.
Thank you you guys so much!!