Hello everyone,
I have a problem with presenting data from DB. There is short introdcution:
In SQL DB SERVER i have a table called email request and there are rows called id, request number, sender, title, recieved at, email body and folder id. This is table stores data about emails. The problem is that you can have many mails from one person that are related to one request number and i would like to present them in one grid - all of them.
I've created a expression rule to get request mail by request Number
a!queryEntity( entity: cons!SAMPLEDATASTOREENTITY, query: a!query( filter: if( rule!APN_isBlank(ri!requestNumber), null, a!queryFilter( field: "requestNumber", operator:"=", value: ri!requestNumber ) ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) )).data
But the problem is when i would like to present this on my interface via TEST(for eg. rule!AA_getRequestMalByRequestNumber("SOME REQUEST NUMBER123")and this is presenting me just first row with this number
Can somebody help me with this present all of them in this grid
Thank you in advance Dawid
Discussion posts and replies are publicly visible
a!gridField( label: "mailing with branch", labelPosition: "ABOVE", totalCount: 5, columns: { a!gridTextColumn( label: "Sender", data: {ri!request.updatedBy, ri!requestemail.sender} ), a!gridTextColumn( label: "Date", data: {ri!request.updatedOn, ri!requestemail.receivedAt} ), a!gridTextColumn( label: "Message Content", data: {"Reasons for referral for improvement: "& ri!request.errorType&"."& ri!request.errorType2 & ri!request.errorType3& ri!request.errorType4& ri!request.errorType5&" "& "Comment: "& ri!request.errorDetails, rule!AA_getRequestemailbyRequestNumber("AA-B-181002-557")} --------------/* WHEN I TYPE THIS NUMBER IT RETURNS BOTH EMAIL BODIES BUT IT RETURNS ENTIRE ROWS LIKE ID REQUEST NUMBER SENDER ETC HOW CAN I GET RID OF THIS EXCEPT EMAIL BODY */ ) }, value: a!pagingInfo(startIndex: 1, batchSize: 10), saveInto: {}, showwhen: or(ri!request.requestStatus=5, ri!request.requestStatus=10), disabled: false, validations: {}, shadeAlternateRows: true )
For just returning the email body, you can use the index() function to pull it out.
Example:
=load( local!emailCdt: rule!AA_getRequestemailbyRequestNumber("AA-B-181002-557"), local!emailBody: index( local!emailCdt, "emailBody", /* replace with the correct field name */ {} ), a!textField(value: local!emailBody) )
If you only want the email body whenever you use this query, you can further optimize by adding a selection to your query and selecting only the body text column you want returned.
It gave me below resulte:
[@attributes=[@anyAttribute=[validationGroups:,requiredMessage:,_cId:6aba5f15b6e2bb4676dbfc5e0fdb47af], @nil=], label=, instructions=, required=, readOnly=, disabled=, placeholder=, value=done
; Poprawione
, validations=, saveInto=<<jA0EAwMCtBWatGjy+sIB0sB1Ad3r5dMThoeAbCFLzPCW3FqgJ3S70wpDF8dfJwzAUTf/i4lz08n5
+G/DNFllDtPZbVIZbI/eoHIKXdwusnZwDcaRYBXEC54rwYDD90Qbvd342/PfXPz5qPia8rkHeq4D
7DmSW02QCI++AD/RdT4cLNYd/6iVCMLH9lsmpm9b8EXpKCCQSydgLeEFPI+YumnU8/YP/q3jkgIL
Hur6pjIeGAtqY42DdHIrE0WG2tbi3/beODQXE7NOXrb7zFwuoYTcqW2Qi6VOEaAs6GYt6MBWQroq
BxWWKjgxOiVBVwvCRSPaQAekpXo8pDIj/e5c+LuSttsNGPETw20gF6hQ1qOCyO2zeGXh9lmkD4Z7
zKhExvCiL42sAklggFhKHMK9ZTJJinknsxES1yzmDulDERS1OT4N36oU
>>, refreshAfter=UNFOCUS, keyboard=STANDARD, labelPosition=ABOVE, align=DEFAULT, actions=, helpTooltip=, masked=]