0

I need to isolate parts of a document name so that the workflow (SPD 2010) can update respective metadata fields.

Doc Name is within the following format : yyyymmdd.xxxx.xxxxxxxx.xxxx.xxxxxxxx

The need is to extract 3 metadata fields within the name of doc shown above. I want to create calculated columns to go about doing this but getting stuck. I know that we can use string functions, however, the find string within string function is not available via SPD 2010 wf's and our current 2013 version is not working (ticket open with MS but client needs workaround).

  • Two things: Is this method required for managing metadata? Or can you use another method (Such as making a taxonomy via the Managed Metadata service)? And are the yyyymmdd.xxxx.xxxxxxxx.xxxx.xxxxxxxx format all the same length (eg, is the second metadata always 4 characters, and the third matadata always 8 characters? – KGlasier Sep 17 '18 at 17:38
  • The character length will always be consist. And at the moment, we're just trying to create the same instance as that with the 2013 process so as not to change the process for the users. – Lauren Sep 17 '18 at 18:02
2

Instead of using LEFT and RIGHT, you could just use MID.

Returns "JUNK" from the KGlasier example.

=MID( [Doc Name], 10,4 )  

MID( string, startChar, numberOfChars )

  • Nice! Didn't know about MID. +1 – KGlasier Sep 17 '18 at 20:15
1

To extract the metadata values from the Doc Name column you can use the =RIGHT(<TEXT>,<LENGTH>) and =LEFT(<TEXT>,<LENGTH>) functions. As long as the length of each metadata is the same (Where yyyymmdd.xxxx.xxxxxxxx.xxxx.xxxxxxxx is always of lengths 8.4.8.4.8) then these formulas should work...

// If [Doc Name] is 20180917.JUNK.JAZZLIKE.QUIZ.BLIZZARD

=LEFT(
   RIGHT(
      [Doc Name],
      LEN([Doc Name])-9
   ),
   4
)
// Returns JUNK

=LEFT(
   RIGHT(
      [Doc Name],
      LEN([Doc Name])-14
   ),
   8
)
// Returns JAZZLIKE

=LEFT(
   RIGHT(
      [Doc Name],
      LEN([Doc Name])-23
   ),
   4
)
// Returns QUIZ

=LEFT(
   RIGHT(
      [Doc Name],
      LEN([Doc Name])-28
   ),
   8
)
// Returns BLIZZARD

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.