SharePoint Online Modern Page Calculated Choice Column in Document Library

%3CLINGO-SUB%20id%3D%22lingo-sub-841410%22%20slang%3D%22en-US%22%3ESharePoint%20Online%20Modern%20Page%20Calculated%20Choice%20Column%20in%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-841410%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20we%20would%20like%20to%20create%20calculation%20that%20can%20offer%20different%20choices%20based%20on%20another%20column%20value.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20a%20choice%20column%20called%20%E2%80%9CObject%E2%80%9D%20and%20the%20user%20can%20able%20to%20select%20the%20following%20values%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EBooks%3C%2FLI%3E%3CLI%3EGadgets%3C%2FLI%3E%3CLI%3EFurniture%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThen%20we%20have%20a%20calculated%20choice%20column%20called%20%E2%80%9CObject%20Type%E2%80%9D%20that%20should%20offer%20options%20based%20on%20the%20selection%20value%20in%20%E2%80%9CObject%E2%80%9D%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20%E2%80%9CObject%E2%80%9D%20%3D%20%E2%80%98Books%E2%80%99%20then%2C%20%22Object%20Type%22%20choice%20options%20needs%20to%20be%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EFiction%3C%2FLI%3E%3CLI%3ENon-Fiction%3C%2FLI%3E%3CLI%3EEducational%3C%2FLI%3E%3CLI%3EChildren's%20Books%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIf%20%E2%80%9CObject%E2%80%9D%20%3D%20%E2%80%98Gadgets%E2%80%99%20then%2C%20%22Object%20Type%22%20options%20needs%20to%20be%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3ECellphone%3C%2FLI%3E%3CLI%3EGame%20Console%3C%2FLI%3E%3CLI%3ECameras%3C%2FLI%3E%3CLI%3EMP3s%2FMP4s%3C%2FLI%3E%3C%2FUL%3E%3CP%3EWould%20this%20be%20possible%20to%20do%3F%20We%20tried%20adding%20a%20choice%20column%20in%20a%20Document%20Library%20but%20we%20weren't%20able%20to%20click%20the%20selection%20unless%20we%20enter%20Quick%20Edit%20mode.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-841410%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECalculated%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EChoice%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecolumn%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edocument%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELibrary%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOnline%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-841959%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20Modern%20Page%20Calculated%20Choice%20Column%20in%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-841959%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F404831%22%20target%3D%22_blank%22%3E%40Mark182%3C%2FA%3E%26nbsp%3Bthis%20will%20not%20be%20possible%20if%20you%20want%20to%20modern%20page.%20The%20cascading%20look%20up%2Fdrop%20down%20column%20will%20be%20possible%20if%20you%20use%20the%20classic%20view%20as%20you%20can%20add%20a%20script%20for%20the%20same.%20The%20out%20put%20will%20be%20something%20similar%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130560iCFCCD7BDF9EFB67A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130561i75D5D38AF347A143%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_1.png%22%20title%3D%22clipboard_image_1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20the%20same%20please%20let%20me%20know%20if%20you%20need%20steps%20I%20can%20provide.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842059%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20Modern%20Page%20Calculated%20Choice%20Column%20in%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842059%22%20slang%3D%22en-US%22%3EYou%20would%20have%20to%20build%20a%20powerapp%20to%20accomplish%20this%20that%20uses%20the%20library.%20Or%20classic%20as%20pointed%20out%20but%20powerapps%20is%20only%20current%20way%20unless%20you%20build%20custom%20extensions.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842430%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20Modern%20Page%20Calculated%20Choice%20Column%20in%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842430%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394813%22%20target%3D%22_blank%22%3E%40Vikram_Samal%3C%2FA%3E%26nbsp%3BThank%20you%20very%20much!%20This%20is%20greatly%20appreciated%20though%20we%20are%20already%20using%20the%20modern%20page%20frequently%2C%20can%20you%20provide%20the%20steps%20to%20do%20this%20in%20classic%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-842431%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20Modern%20Page%20Calculated%20Choice%20Column%20in%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-842431%22%20slang%3D%22en-US%22%3EThis%20is%20noted%20Chris.%20Thanks%20for%20the%20response.%20Highly%20appreciated!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-844368%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20Online%20Modern%20Page%20Calculated%20Choice%20Column%20in%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-844368%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F404831%22%20target%3D%22_blank%22%3E%40Mark182%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECreate%20one%20Country%20List%20in%20which%20we%20are%20storing%20our%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECountry%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Evalues%20in%20Title%20field.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20339px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130752i2E91E198970001FC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22country-list%22%20title%3D%22country-list%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EWe%20have%20another%20list%20named%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EStates%3C%2FSTRONG%3E%2C%20in%20which%20we%20are%20storing%20state%20values%20in%20Title%20field.%20This%20list%20also%20has%20a%20lookup%20field%20named%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ECountry%3C%2FSTRONG%3E%26nbsp%3Bin%20which%20we%20are%20storing%20corresponding%20countries%20from%20Country%20List.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20337px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130753iB1AD7CBF7D31369A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22states-list%22%20title%3D%22states-list%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EStates%20List%20with%20Country%20as%20Lookup%20field.%20Now%20we%20have%20third%20list%20named%20Information%20in%20which%20there%20are%20two%20lookup%20fields%3A%26nbsp%3B%3CSTRONG%3ECountry%3C%2FSTRONG%3E%26nbsp%3Band%26nbsp%3B%3CSTRONG%3EState%3C%2FSTRONG%3E%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20432px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F130756i5019D3A7AC3038FC%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22information-list-with-country-and-state-as-lookup-fields%22%20title%3D%22information-list-with-country-and-state-as-lookup-fields%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EJust%20add%20below%20script%20in%20Content%20editor%20webpart%20on%20NewItem%20and%20EditItem%20page.%3C%2FP%3E%3CP%3E%3CSCRIPT%20src%3D%22%26quot%3B%2F%2Fcode.jquery.com%2Fjquery-1.10.1.min.js%26quot%3B%22%3E%3C%2FSCRIPT%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSCRIPT%20type%3D%22%26quot%3Btext%2Fjavascript%26quot%3B%22%3E%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%24(document).ready(function()%20%7B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%24().SPServices.SPCascadeDropdowns(%7B%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BrelationshipList%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BStates%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BrelationshipListParentColumn%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BCountry%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BrelationshipListChildColumn%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BTitle%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BparentColumn%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BCountry%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3BchildColumn%3A%20%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3BState%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3Bdebug%3A%20true%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D)%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%7D)%26amp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSCRIPT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

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.

5 Replies
Highlighted

@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:

clipboard_image_0.png

clipboard_image_1.png

 

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

Highlighted
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.
Highlighted

@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?

Highlighted
This is noted Chris. Thanks for the response. Highly appreciated!
Highlighted

@Mark182 

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

 

country-list

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

 

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

 

information-list-with-country-and-state-as-lookup-fields

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.