Hi All,
I am trying to configure a Paging Grid Selection Component (see definition code below). The grid will show a number of CDTs - comments coming from different approvers in a long running process. However, when a user clicks on a row in the grid, I would like the text in the "comment" field of the selected row to be displayed in an a!paragraphField interface control that is placed outside the grid control on the interface. Does anyone have guidance as to how I may go about this?
Thanks in advance.
---
local!commentsQuery: a!queryEntity( entity: cons!CSHV_COMMENT_CDT, query: a!query( selection: a!querySelection(columns: { a!queryColumn(field: "author"), a!queryColumn(field: "timeStamp"), a!queryColumn(field: "status"), a!queryColumn(field: "comment"), }), filter: a!queryFilter( field: "cashAdvanceId.id", operator: "=", value: ri!CashAdvanceData.id ), PagingInfo: local!commentsPagingInfo )),
...
Discussion posts and replies are publicly visible
Hi Susan,
Please find the below code snippet,
load( local!input: { { id: 1, author: "Jack", status: "In Progress", comment: "Level 1 Approved" }, { id: 2, author: "James", status: "Completed", comment: "All documents are verified" }, { id: 3, author: "Lily", status: "Rejected", comment: "Level 1 Approved" } }, /* Use query entity to get data to local!input*/ local!pagingInfo: a!gridSelection( pagingInfo: a!pagingInfo( 1, - 1 ) ), a!formLayout( contents: { a!gridField( totalCount: count( local!input ), columns: { a!gridTextColumn( label: "Author", field: "author", data: index( local!input, "author", null ) ), a!gridTextColumn( label: "Status", field: "status", data: index( local!input, "status", null ) ), a!gridTextColumn( label: "Comment", field: "comment", data: index( local!input, "comment", null ) ) }, value: local!pagingInfo, saveInto: local!pagingInfo, identifiers: local!input.id, selection: true, validations: if( count( local!pagingInfo.selected ) > 1, "Only one row can be selected", {} ) ), a!paragraphField( label: "Comment", readOnly: true, value: index( local!input.comment, wherecontains( local!pagingInfo.selected, local!input.id ), null ), showWhen: and( not( rule!APN_isBlank( local!pagingInfo.selected ) ), count( local!pagingInfo.selected ) = 1 ) ) } ) )
Few Suggestions,
Also, please find below the links to sail recipes for more info about paging grid.
https://docs.appian.com/suite/help/18.2/recipe_select_rows_in_a_grid.html
https://docs.appian.com/suite/help/18.2/recipe_limit_the_number_of_rows_in_a_grid_that_can_be_selected.html
https://docs.appian.com/suite/help/18.2/recipe_delete_rows_in_a_grid.html
Hope this helps!!!
Thanks,
Hema
Please try the below code for a!textField()
a!textField( label: "Selected Employee IDs", readOnly: true, value: if( length( local!gridSelection.selected ) = 0, "No employees selected", index( local!datasubset.data.firstName, wherecontains( local!gridSelection.selected, local!datasubset.identifiers ), null ) ) )
Hi Susan, Please try the below code snippet, a!textField( label: "Selected Comment Row", readOnly: true, value: if( length( local!gridSelection.selected ) = 0, "No comment row selected", index( local!datasubset.data.comment, wherecontains( local!gridSelection.selected, local!datasubset.identifiers ) ) ) ) Thanks, Hema