output the content of CMS.USER

Yang Wen asked on September 5, 2016 07:57

I have a need to output the entire cms.user as a js object array that can then be consumed by client-side JS code.

I thought the query data source would allow access to any Kentico table. However, it only supports custom tables and page tables.

Is there a way to hook up a data source webpart to the cms.user table so that I can output it with a repeater?

I'm avoiding the REST service because I want the JS array to be send with the page, to avoid another round trip to the server.

Correct Answer

Kristian Bortnik answered on September 5, 2016 08:24

The query data source webpart indeed only allows you to choose "Page type" and "Custom table". However, this does not limit you from retrieving data from any table you like.

For example, add a query data source webpart to a page.
For the "Query name" field, click "New".
For "class type", select "Custom table".
For "custom table", select "Sample table".

You can then enter a query name (such as MyUsersQuery), and your query text could retrieve data from the CMS_User table.


The full codename of your query would then be customtable.SampleTable.MyUsersQuery

It then comes down to organising your queries correctly - make sure you store them in an organised fashion, maybe by creating a "container only" page type named "System table queries".

0 votesVote for this answer Unmark Correct answer

Recent Answers

Richard Sustek answered on September 5, 2016 08:46

You can actually use either:

1) Repeater with custom query web part which enables you to use your own SQL query (so you can get data from any table you want)

2) Basic repeater in combination with SQL Data source web part which also enables you to use your own SQL Query

Both of these are really easy to use and would be preferred over the query data source in this context.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.