SharePoint online : I want to develop a portal where content will be in subsite (sub sites will be created based on country name). Now depending on the current logged in user country, data should be pulled from that country subsite

Any thoughts on how will i be able to pass parameter from user profile to REST API to pull data from subsite.

2 Answers 2


To fetch data from sub-site based on country of logged in user, you can use:

Now exact answer to your Question:

  1. Fetch Current user and Country using JSOM or Rest API
  2. Use CAML Query to filter data from Rest Call to subsiteCAML Query to filter from Country of user
  3. Use Data received from Rest Call to display the same using HTML

Tutorial Link for Rest API :Code Project REST API Tutorial

  • @MonicaJagani Did it work? Jun 16, 2016 at 4:20
  • I will updated once i get it working as per the requirements. On high level, it seems i could use one of the methods Jun 16, 2016 at 5:55

Try below rest call This will get data from the current page location

var getTitleURL  =  "/_api/web/lists/getbytitle('Products')/items?

and this will

var getTitleURL  =  "/subsitesites/_api/web/lists/getbytitle('Products')/items?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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