locked
Updating a (calculated) field based on lookup field :: Workarounds RRS feed

  • Question

  • Hi All,

    I am a site owner in SP2010 impl., at work. Not a farm admin / super admin.

    For one of my needs, I am designing a list using Datasheet View. I have columns of People, Lookup and Choice datatypes. I am trying to introduce a (calculated) column, whose value will depend on the values in the above said fields (people, lookup and choice). I tried the following: - First, tried using calculated column. But, calculations based on people or lookup fields is not allowed. Hence no success. - Then I tried Workflow to update the calculated field. It works, but gives me another problem. I had set the workflow to start when a list item gets updated - and it does start. In the front end, the update from workflow does not reflect immediately. As a result, when I attempt to re-edit, or update again, it shows a conflict.

    I had been trying to get a workaround to make one of the two options above (a way to use calculated columns based on lookup and people columns, or, make datasheet view refresh the view so that workflow updated values reflect immediately)

    Regds,

    SKB

    Saturday, September 6, 2014 6:45 AM

Answers

  • Hi Siva,

    According to your description, my understanding is that you want to create a calculated field based on a lookup column or people column.

    I suggest you achieve it using InfoPath Designer. You can click “Customize Form” under List ribbon, then it will open the form with InfoPath Designer. Then add a Text Box, and set it ready-only. After that, create an action rule on the lookup field or people column to set the value of the Text Box. Save and publish the form. Then the value of Text Box will be changed based on the lookup cloumn or people column like a calculated field.

    Or you can use a Calculated Value Object in InfoPath Designer instead of the Text Box.

    About Rules in InfoPath, you can refer to the link:

    http://www.c-sharpcorner.com/UploadFile/40e97e/sharepoint-2010-%E2%80%93-infopath-forms-and-rules/

    Best Regards,

    Wendy


    Wendy Li
    TechNet Community Support

    • Proposed as answer by romeo donca Monday, September 8, 2014 9:14 AM
    • Marked as answer by Lindali Friday, September 12, 2014 11:55 AM
    Monday, September 8, 2014 8:18 AM

All replies

  • Hi Siva,

    According to your description, my understanding is that you want to create a calculated field based on a lookup column or people column.

    I suggest you achieve it using InfoPath Designer. You can click “Customize Form” under List ribbon, then it will open the form with InfoPath Designer. Then add a Text Box, and set it ready-only. After that, create an action rule on the lookup field or people column to set the value of the Text Box. Save and publish the form. Then the value of Text Box will be changed based on the lookup cloumn or people column like a calculated field.

    Or you can use a Calculated Value Object in InfoPath Designer instead of the Text Box.

    About Rules in InfoPath, you can refer to the link:

    http://www.c-sharpcorner.com/UploadFile/40e97e/sharepoint-2010-%E2%80%93-infopath-forms-and-rules/

    Best Regards,

    Wendy


    Wendy Li
    TechNet Community Support

    • Proposed as answer by romeo donca Monday, September 8, 2014 9:14 AM
    • Marked as answer by Lindali Friday, September 12, 2014 11:55 AM
    Monday, September 8, 2014 8:18 AM
  • Wendy, Hi!

    Foremost, many thanks for your response!

    Unfortunately, I just own a site in the farm.  I am not a super admin / farm admin.  And my organization has disallowed edits through InfoPath.  I am trying to reach out to my admin colleagues to let me do so.  I will keep you posted on what comes out...

    Regds,

    SKB


    Regds, SKB

    Tuesday, September 16, 2014 6:30 AM
  • It is possible by adding some JavaScript in a Calculated Column which extracts the Lookup values from the Ctx ClientContext javascript object availale once the View has loaded

    http://sharepoint.stackexchange.com/questions/130377/calculate-field-with-a-lookup-additional-column

    For display puposes fine

    BUT this only displays the value in the View, it does not update any fields in the Item, so you can't use the result in a next calculation.

    If you want that you either have to go the workflow route, or add some extra lines of Javscript to update the item (which will only be executed if the View is displayed!)

    Wednesday, March 11, 2015 1:10 PM