Forum Discussion
jeffshurtliff Thanks for the reply! I'm a bit stuck on how to translate the following query into a custom endpoint:
"SELECT id, login, email, rank.name, rank.simple_criteria.role.id FROM users"
The example given in the docs is a bit simplistic.. Could you give me a pointer or two on how to convert the above LiQL? After the endpoint is constructed, do I call it between the <@liaAddScript> tags or do I pass it into a fetch( )?
Thanks!
charlesssgraham You can add your query ("SELECT id, login, email, rank.name, rank.simple_criteria.role.id FROM users") to a custom component in studio using the below API V2:
<#assign query = restadmin("2.0","/search?q=" + "SELECT id, login, email, rank.name, rank.simple_criteria.role.id FROM users"?url).data.items/>
<#list query as q>
${q.id}
${q.login}
${q.email}
${q.rank.name}
<#if q.rank.simple_criteria.role?? && q.rank.simple_criteria.role.id??>
${q.rank.simple_criteria.role.id}
</#if>,
</#list>
Then you can add this custom component to your desired page in your community in studio.
Hope this helps.
- charlesssgraham3 years agoContributor
This absolutely helps! Thank you for your reply!
Related Content
- 2 years ago
- 2 years ago
- 4 years ago
- 3 years ago