1

Ideally, I would love to use jQuery/js for this. I don't know how to use Powershell.

In my SharePoint Online App, I have 2 Lists

  1. An Item List called 'Cities', with a Title field. Each item's Title field is the name of a City.
  2. A Document Library called 'CityDocs'. The 'CityDocs' Document Library has a Lookup Field called 'CityId', which is populated by the 'City' Item List.

I have made a Site Page with (2) Web Parts:

Web Part 1. Document Library LVWP called 'CityDocs' (the name of the Document Library) Web Part 2. List Filter whose values are populated values by an Item List called 'Cities'

The Scenario When a City is selected in the List Filter WP, I'd like any documents that are dragged into the Document Library WP to have the value in the 'City' List Filter WP applied to the new Document's 'CityId' column.

Example The user has selects 'Charleston' in the List Filter WP. The user then drags a new document into the Document Library WP. The empty 'CityId' column is automatically populated with the value 'Charleston'

Thanks a lot!

-1

In order to accomplish this, you will need to create a custom web part that will act as the drop-zone for the documents. This web part will take care of uploading the documents to the final destination and populate the CityId column based on the selection made by the user. You won't be able to create a solution that is pure out-of-the-box with these requirements.

Check out this question as it will give you some pointers on how to upload documents from JS. Additionally, check out this question that will give you some pointers on how to retrieve the City value directly from the list view webpart.

-Hope it helps.

  • Thanks for the response. Let me make sure I understand what you're saying...I can make a Content Editor WP, place it on my Site Page, and drop the 'JS using the SharePoint web services' script in there. Then I upload the second script "get the selected items of list in the javascript" in a Script Editor WP on the Site Page. Should I be deleted the Doc library WP from the page? – TheJDScott Jan 19 '17 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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