Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
11 replies
Subscribers
8 subscribers
Views
3679 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
Grid field display using CDT
Dastagiri Dudekula
over 7 years ago
I am trying to display a grid field using a Employee CDT which has nested Skill CDT, association between these two CDTs is one to many. For an instance it's like one employee with multiple skills.
When I am trying to display it says the total count of grid is different from the number of rows to be displayed.
Can anyone help me by providing multiple solutions to solve this issue?
OriginalPostID-240663
Discussion posts and replies are publicly visible
0
Stefan Helzle
A Score Level 3
over 7 years ago
I have exactly the data structure in a small demo I am just building. To show employees in the record grid I use following expression
joinarray(index(rf!skills, "name", {}), char(10))
If you put this into a rule and use apply in the grid text column it should list all skills in a list for each employee.
Attached a screenshot of how it looks for me.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dastagiri Dudekula
over 7 years ago
Thank you Mr. Stefan.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 7 years ago
You are welcome :-)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sachin
A Score Level 1
over 7 years ago
I have the same requirements, I used the views but thanks Stefan for the simple solution
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dastagiri Dudekula
over 7 years ago
@Sachin Could you please explain how did you achieve this problem in you way? I just want to know the ways to solve this issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shashank
over 7 years ago
@Dastagiri ..
You can write a view which combines all the data from all the tables related to that perticular employee .. for example , you have an address table as well as a skill table which have 'employee_id' as the foreign key .
So you can create a single view which contains all the addresses , skills and other details of an employee into a single row ,by using joins or inner select queries
You can now map this view to a CDT which can be further used in your application and can perform a!queryEntity to retreive the data
Hope it is helpful !!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sachin
A Score Level 1
over 7 years ago
@Dastagiri refer this link for brief understanding about database views
forum.appian.com/.../Using_Database_Views.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sachin
A Score Level 1
over 7 years ago
Hope this is helpful
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rama Thummala
Certified Lead Developer
over 7 years ago
@Shashank , @Sachin
Here as mentioned by @Stefanh ,we have direct solution for the issue in Appian (by using joinarray), then Why do we go for DB Views?
As per my knowledge if we create views, while moving applications to different environment, again we need to create those views .
If I am not wrong, we can achieve the same by using Appian functions in your case.
I am not sure about the performance issues with Appian functions over DB views.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rama Thummala
Certified Lead Developer
over 7 years ago
@Dastagiri
The reason for the issue is :
Suppose there are three cells in a column that contain 11, the array 22 and 23, and 33. We might expect this index function to return: { 11, { 22, 23 }, 33 } However, in most cases when arrays are nested, one single array is created using the elements the nested arrays. So { 11, { 22, 23 }, 33 } becomes { 11, 22, 23, 33 }. You can try this yourself by testing an expression rule with the definition length({ 11, { 22, 23 }, 33 }).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>