how to achieve cascading drop-down values in modern sharepoint library??

Raki 481 Reputation points
2020-11-11T22:10:31.95+00:00

Hello,

we are trying to have cascading drop-down functionality in Modern SharePoint document library during upload. we are using two levels of folder structure with root folder as Agent Name and sub-folder as Project Name. now when user will go inside the Project Name folder Agent name should be automatically selected from drop-down and should display all related project name only for that agent. As an example lets say i have Agent A, Agent B folder and so on.. in the library. Inside of the Agent A folder there are folders with all different projects name. now if i go inside of any project name folder to upload files, can i have auto populated agent name and the project name in the right pane? FYI, I will have others meta data values too to manually tag the documents during upload.

Thanks for your help!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Itch Sun-MSFT 2,566 Reputation points
    2020-11-12T09:58:37.617+00:00

    Hi @Raki

    I recommend you to use flow to complete this requirement.

    You can refer to the screenshot below:

    Since you need to get the folder name, we need to create several variables.

    39362-image.png

    Next, we should get the value of variables:

    39363-image.png

    The formula for each variable is as follows:

    Path:

    substring(body('Get_file_properties')?['{Path}'],0,sub(length(body('Get_file_properties')?['{Path}']),1))  
    

    Index:

    lastIndexOf(variables('Path'),'/')  
    

    Folder name:

    substring(variables('Path'),add(variables('Index'),1))  
    

    Finally we update the file attributes:

    39325-image.png

    Test result:

    39316-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. Raki 481 Reputation points
    2020-11-12T14:15:45.863+00:00

    Hello,

    Very much appreciated for your effort on this. For some reason i don't see the document library name in the Update Item step. how can i resolve this issue? is it something i need to use list to get values?

    Note: i need to get Agent name and project name from folders in the right pane automatically when they will upload from inside of project name folder but for all others meta-data values i would like to allow user to enter manually in same right pane from content type.

    Thanks

    39338-capture1.jpg

    39396-capture.jpg


  3. Raki 481 Reputation points
    2020-11-13T16:15:08.417+00:00

    i was able to get the Project name folder value during the upload but still need to get Agent name folder value from the root folder. Because i have two levels folders. start with Agent Name folder and then inside project name folders and users will upload files only from inside of project name folder. so we would like to get both folder values (Agent name , project name) when they upload files from inside project name folder.

    Thanks again!

    39715-image.png

    0 comments No comments

  4. Raki 481 Reputation points
    2020-11-17T22:23:04.537+00:00

    Hello,

    Any help on this please to get the root folder value as well. i was able to get the sub-folder value (project name) but not the root folder value(Agent name). so my requirement is to get the both folders value during upload from inside of the sub-folder.

    Thanks in advance!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.