Forum Discussion

Mark182's avatar
Mark182
Copper Contributor
Sep 06, 2019

SharePoint Online Modern Page Calculated Choice Column in Document Library

Hello, we would like to create calculation that can offer different choices based on another column value.

 

Example:

 

We have a choice column called “Object” and the user can able to select the following values:

 

  • Books
  • Gadgets
  • Furniture

Then we have a calculated choice column called “Object Type” that should offer options based on the selection value in “Object” column.

 

If “Object” = ‘Books’ then, "Object Type" choice options needs to be:

 

  • Fiction
  • Non-Fiction
  • Educational
  • Children's Books

If “Object” = ‘Gadgets’ then, "Object Type" options needs to be:

 

  • Cellphone
  • Game Console
  • Cameras
  • MP3s/MP4s

Would this be possible to do? We tried adding a choice column in a Document Library but we weren't able to click the selection unless we enter Quick Edit mode.

  • You would have to build a powerapp to accomplish this that uses the library. Or classic as pointed out but powerapps is only current way unless you build custom extensions.
    • Mark182's avatar
      Mark182
      Copper Contributor
      This is noted Chris. Thanks for the response. Highly appreciated!
      • Vikram_Samal's avatar
        Vikram_Samal
        Steel Contributor

        Mark182 

        Create one Country List in which we are storing our Country values in Title field.

         

        We have another list named States, in which we are storing state values in Title field. This list also has a lookup field named Country in which we are storing corresponding countries from Country List.

         

         

        States List with Country as Lookup field. Now we have third list named Information in which there are two lookup fields: Country and State

         

        Just add below script in Content editor webpart on NewItem and EditItem page.

        <script src="//code.jquery.com/jquery-1.10.1.min.js"></script>

        <script type="text/javascript">
        $(document).ready(function() {
        $().SPServices.SPCascadeDropdowns({
        relationshipList: "States",
        relationshipListParentColumn: "Country",
        relationshipListChildColumn: "Title",
        parentColumn: "Country",
        childColumn: "State",
        debug: true
        })
        })
        </script>

         

        Please let me know if this helps.

  • Vikram_Samal's avatar
    Vikram_Samal
    Steel Contributor

    Mark182 this will not be possible if you want to apply in modern page. The cascading look up/drop down column will be possible if you use the classic view as you can add a script for the same. The out put will be something similar:

     

    For the same please let me know if you need steps I can provide.

    • Mark182's avatar
      Mark182
      Copper Contributor

      Vikram_Samal Thank you very much! This is greatly appreciated though we are already using the modern page frequently, can you provide the steps to do this in classic?

Resources