I am developing a Ribbon action sharepoint hosted app where user selects any number of items and clicks the ribbon action to Print the list items.

In the SharePoint hosted app page I want to retrieve the list items. Now, the ribbon action app can be used on any Custom List, so the fields to be retrieved from the list items is not definite always.

I want to retireve and print values for only those columns which are visible in the current view where the user selects list items and clicks on the app. I know that the current list view details can be obtained from SP.ListOperation but that will not work here as I am redirecting to an app. Any suggestions how can I pass the current list view name (by query string parameter ? )


You should be able to find some help from this MSDN article on the matter.

Ribbon custom actions use SelectedListId and SelectedItemId. ListId and ItemId work only with menu item custom actions.

|improve this answer|||||
  • I've seen that article. Cannot find a way to send the current view information so that I can get the fields in that view and subsequently the filed values from list items. – Vipul Kelkar Jun 1 '15 at 8:16
  • @VipulKelkar To my understanding you should be able to get those property values through the QueryString as you would with HostUrl, AppWebUrl etc. – user2536 Jun 1 '15 at 8:20

I found the answer to this. We can pass a query string parameter {Source} which passes the HTTP request URL.


In my case, since the app is triggered from as custom ribbon action, i get the list view URL in query string. From this I can get the list view name and similarly the fields in that list using CSOM.

|improve this answer|||||

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.