Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
Hi,
I have list of maps in a local variable . I am using it in grid field . I need to apply sort to the columns. Sorting is supported only when the data is from query entity or record. Is there any workaround where we can manually apply sort to the grid when the data is a list of map. Sample code.
a!localVariables( local!data: { a!map(id: 1, uin: 234, count: 5, ), a!map(id: 2, uin: 232, count: 5, ), a!map(id: 3, uin: 28, count: 5, ) }, a!gridField( data: local!data, columns: { a!gridColumn(label: "ID", value: fv!row.id), a!gridColumn(label: "UIN", value: fv!row.uin), a!gridColumn(label: "COUNT", value: fv!row.count) } ) )
Can you please help me with the sorting
Discussion posts and replies are publicly visible
You can try this
a!localVariables( local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50, sort: a!sortInfo(field: "id", ascending: true) ), local!data: { a!map(id: 1, uin: 234, count: 5), a!map(id: 2, uin: 232, count: 5), a!map(id: 3, uin: 28, count: 5) }, a!gridField( data: todatasubset(local!data, local!pagingInfo), columns: { a!gridColumn( label: "ID", sortField: "id", value: fv!row.id ), a!gridColumn( label: "UIN", sortField: "uin", value: fv!row.uin ), a!gridColumn( label: "COUNT", sortField: "count", value: fv!row.count ) }, pagingSaveInto: local!pagingInfo ) )
It is working. Thank you