SOLVED

Working with the file name

%3CLINGO-SUB%20id%3D%22lingo-sub-2281395%22%20slang%3D%22en-US%22%3EWorking%20with%20the%20file%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2281395%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20fairly%20new%20to%20Sharepoint%20and%20also%20working%20with%20a%20German%20version%2C%20so%20please%20excuse%20and%20correct%20any%20wrong%20terminology.%20I%20will%20put%20an%20*%20behind%20any%20term%20I%20translated%20myself.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20SP2016%2C%20I%20have%20an%20image%20library*%20and%20have%20added%20a%20column*%20of%20the%20type%20%22Calculate%22*.%20I%20am%20looking%20for%20a%20formula%20that%20gives%20me%20the%20filename%20%22AnyImage.gif%22%2C%20just%20as%20%3D%5BAnyColumnName%5D%20would%20give%20me%20what%20is%20in%20that%20column.%20I%20was%20hoping%20naively%20that%20%3D%5BNAME%5D%20would%20do%20that%2C%20but%20it%20produces%20an%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20someone%20help%20me%20in%20this%20particular%20case%2C%20or%20direct%20me%20to%20a%20guide%20how%20to%20access%20the%20%22special%20columns%22%20of%20a%20list*%20in%20general%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BNils.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2281395%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFiles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2282420%22%20slang%3D%22en-US%22%3ERe%3A%20Working%20with%20the%20file%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2282420%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1033674%22%20target%3D%22_blank%22%3E%40NilsRichter%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20a%20known%20limitation%20of%20SharePoint.%20We%20cannot%20use%20file%20name%20in%20calculated%20column%20formula.%3C%2FP%3E%3CP%3EThere%20is%20a%20SharePoint%20UserVoice%20for%20this.%20You%20can%20vote%20here%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsharepoint.uservoice.com%2Fforums%2F329214-sites-and-collaboration%2Fsuggestions%2F36029680-use-filename-in-calculated-field%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EUse%20filename%20in%20calculated%20field%3C%2FA%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EWorkaround%3C%2FSTRONG%3E%3A%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3ECreate%20a%20new%20text%20field%20%26amp%3B%20populate%20its%20value%20using%20workflow%20on%20item%20creation%2Fupdate.%20Hide%20this%20field%20from%20property%20forms.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EUse%20workflow%20to%20updated%20the%20Title%20field%20based%20on%20the%20filename.%20Then%20use%20Title%20field%20in%20the%20calculated%20column%20formula.%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%26nbsp%3B%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%26nbsp%3B%26amp%3B%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi,

 

I am fairly new to Sharepoint and also working with a German version, so please excuse and correct any wrong terminology. I will put an * behind any term I translated myself.

 

On SP2016, I have an image library* and have added a column* of the type "Calculate"*. I am looking for a formula that gives me the filename "AnyImage.gif", just as =[AnyColumnName] would give me what is in that column. I was hoping naively that =[NAME] would do that, but it produces an error.

 

Can someone help me in this particular case, or direct me to a guide how to access the "special columns" of a list* in general?

 

Thanks in advance,

         Nils.

1 Reply
best response confirmed by NilsRichter (Occasional Visitor)
Solution

@NilsRichter 

It's a known limitation of SharePoint. We cannot use file name in calculated column formula.

There is a SharePoint UserVoice for this. You can vote here: Use filename in calculated field

Workaround:

  1. Create a new text field & populate its value using workflow on item creation/update. Hide this field from property forms.

  2. Use workflow to updated the Title field based on the filename. Then use Title field in the calculated column formula.


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.