Expand my Community achievements bar.

SOLVED

How to join table in LCDS

Avatar

Former Community Member

Hello,

How can I join tables in LCDS and show them in a datagrid?

I run LCDS3 and tomcat.

All help is appricitated

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

User (firstName, lastName,Address)

Address(streetAddress,State, Country,Zipcode)

If you wanted to show the data below in your data grid

---------------------------------------------------------------------------

firstName        |       lastName   |  State

---------------------------------------------------------------------------

user.firstName | user.lastName | user.address.state

View solution in original post

3 Replies

Avatar

Former Community Member

If an entity has relationships, joins are implicit e.g.: A customer can have multiple orders - Having access to customer gives you access to all the orders associated with the customer. Here the joins are implicit.

However, we don’t support randomly joining tables (that don't have a relationship in the data model) in this release. You are required to create a custom data management assembler, which gives you full control over the SQL. It is likely that the next release may support joining tables directly from the data model.

-Anil

Avatar

Former Community Member

Thank you very much Amil for this information.

In my example, how can I show data from two tables joined implicitly in one datagrid? I can create 2 datagrids, but that is now what I need.

Thank you for time.

Avatar

Correct answer by
Former Community Member

User (firstName, lastName,Address)

Address(streetAddress,State, Country,Zipcode)

If you wanted to show the data below in your data grid

---------------------------------------------------------------------------

firstName        |       lastName   |  State

---------------------------------------------------------------------------

user.firstName | user.lastName | user.address.state

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----