1

I have a managed term set which provides date meta data for a column used by accounts. They tag a document depending on the period (month and year) it relates to.

What I wish to achieve is to have a field containing the YEAR information. I am trying to extract this YEAR data from the existing managed metadata column.

The managed metadata column is contains the date value in the format MMM YY e.g. Jan 18 - I am trying to grab the 18 from the meta data field and copy it to a new column.

If I can create a new (calculated?) column to automatically tag each document with the YEAR it would be a good time saver.

screen shot of meta data field

2 Answers 2

1

I've found a way that works, someone else might be able to improve on this though.

I created a new single line of text field called DateText and I set the default value text, like this:

=[Mgmt Accounts Project]

DateText field

Next I made a workflow which triggers when the item is created or modified.

IF value equals value //I've used my meta data 'date' field here.

SET DateText to Current Item:Value //this returns the MMM YY + a load of garbled crap, which needs snipping off), hence the need to clean it up. Look in the ACTIONS menu, scroll all the way to the bottom and select Extract Substring from Start of String, I need 6 characters from the current 'dirty data':

then copy 6 characters from start of Current Item:Value //return the value as String. The workflow holds this as a variable - so I did this:

Set DateText to [%Variable:substring%] //which pastes the 6 characters to the DateText field. That gives me the YY number I need in the DateText field.

Workflow - set Extract Date from meta data field and SET to DateText

All I need to do then is update my 1000 documents to populate the DateText field. (See what I mean about it not being perfect?). Then I create views based on If DateText field contains e.g. 18 for a view for 2018.

0

If want extract year from Date-time column you use below method

For example you have Date column and you want last 2 character of year for that date column, so you can create calculation column using below formula

=RIGHT(YEAR([Created]),2)

It will return last 2 character of Created Date year,

i.e.

Created Date Is 22/01/2018 then output is 18

Also you can refer this link

3
  • Hi Bharat, thanks for the suggestion, it is a good idea. However, I am limited by the source column I am using - it is a managed metadata field containing date information. When I create a new Calculated column my managed metadata field is not available for use in a formula.
    – Tally
    Commented Jan 22, 2018 at 8:47
  • Hi Tally, I have updated formula and my Answer please check, Let me know it work for you or not? Commented Jan 22, 2018 at 10:09
  • Hi Bharat - this does not work for managed meta data fields, but would work fine for normal field types. My column is using a range of date values which are managed in Site Settings>Term Store Management.
    – Tally
    Commented Jan 22, 2018 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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