We are currently performing maintenance on Appian Community. As a result, discussions posts and replies are temporarily unavailable. We appreciate your patience.
Hi all,
uploaded the documents and showing those documents to the user but i facing error in site page showing
"expression evaluation error [evaluation ID = aae0b:d617b] in rule 'sha_imagelist' at function a!forEach [line 23]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function a!billboardLayout [line 35]: The image in a billboard layout has an invalid value for "document". "document" must not be null".
I checked it by using different function like fco_hasvalue and fco_isnullorempty still i have this issue can anyone help me to resolve this error
a!localVariables( local!listingData:rule!SHA_LISTING_EXPRUL(listingId:index(ri!listing,"listingId",null)), local!houses: rule!SHA_qe_getDocuments( entityId: index(ri!Document,"entityId",null) ), local!address:rule!SHA_qe_toGetPropertyAddressDetails( listingId: local!listingData ), local!appCount: length(local!listingData), local!colCount: 4, local!absoluteDiv: local!appCount/local!colCount, local!quotient: quotient(local!appCount,local!colCount), local!rowCount: if( local!absoluteDiv = local!quotient, local!quotient, local!quotient + 1 ), { a!forEach( items: 1+enumerate(local!rowCount), expression: a!columnsLayout( columns: a!localVariables( local!indexes:(1+enumerate(local!colCount))+(local!colCount*(fv!item-1)), local!indexedVaues: rule!FCO_removeNull(index(local!listingData,local!indexes,null)), local!Vaues: rule!FCO_removeNull(index(local!houses,local!indexes,null)), local!Add: rule!FCO_removeNull(index(local!address,local!indexes,null)), a!columnLayout( contents: { a!cardLayout( contents: { a!billboardLayout( backgroundMedia:a!documentImage( document: /*if(*/ /*rule!FCO_isNullOrEmpty(local!Vaues),*/ /*{},*/ {index(local!Vaues,fv!item,null)} ), height: "SHORT", marginBelow: "NONE", overlay: a!barOverlay( contents: { a!sideBySideLayout( items: { a!sideBySideItem( item: a!richTextDisplayField( label: "Address", labelPosition: "COLLAPSED", value: a!richTextItem( text: index(index(local!Add,"addressline1",null),fv!item,null), size: "MEDIUM", style: "STRONG" ) ) ), a!sideBySideItem( item: a!richTextDisplayField( label: "City & State", labelPosition: "COLLAPSED", value:index(index(local!Add,"city",null),fv!item,null) & "," & index(index(local!address,"province",null),fv!item,null), ), width: "MINIMIZE" ) }, alignVertical: "MIDDLE", showWhen: rule!FCO_hasValue( index(local!Add,fv!item,null) ), stackWhen: "TABLET_LANDSCAPE" ) }, style: "DARK" ), ), }, showBorder: rule!FCO_hasValue( index(local!Add,fv!item,null) ), ), a!cardLayout( contents: a!sideBySideLayout( items: { a!sideBySideItem( item: a!richTextDisplayField( label: "Price", labelPosition: "COLLAPSED", value: a!richTextItem( text:index(index(local!indexedVaues,"price",null),fv!item,null), size: "LARGE", style: "STRONG" ) ) ), a!sideBySideItem( item: a!richTextDisplayField( label: "Beds", value: a!richTextItem( text:index(index(local!indexedVaues,"bedRooms",null),fv!item,null) ) ), width: "MINIMIZE" ), a!sideBySideItem( item: a!richTextDisplayField( label: "Baths", value: a!richTextItem( text:index(index(local!indexedVaues,"bathRooms",null),fv!item,null) ) ), width: "MINIMIZE" ), a!sideBySideItem( item: a!richTextDisplayField( label: "Sq. Ft.", value: a!richTextItem( text:index(index(local!indexedVaues,"squareFootage",null),fv!item,null) ) ), width: "MINIMIZE" ) }, showWhen: rule!FCO_hasValue( index(local!indexedVaues,fv!item,null) ) ), showBorder: rule!FCO_hasValue( index(local!indexedVaues,fv!item,null) ) ) }, width: "NARROW_PLUS", ) ) ) ) } )
Discussion posts and replies are publicly visible
I *think* you want row 41 to be index(local!Vaues, local!indexes, {}) rather than index(local!Vaues,fv!item,null). This assumes that the documents are definitely in the same order as and the same length as the listings.
still i am facing the same issue
What is the data structure of the local!houses and local!Vaues variables? Is it just a list of document ids?
local!houses is list but local!vaues is not a list
And other point to consider is if the backgound is changed dynamic and you have the possibility of not having a document to be used in the document image, you should add your check for null before as the document image dont accept a null document.
Perhaps you could try something like in the code below:
backgroundMedia: if( rule!FCO_isNullOrEmpty(local!Vaues), null(), a!documentImage( document: index(local!Vaues, fv!item, null) ) ),
Hope that helps.
Acacio B.
thank you acacio but i but i am not able to see my images is it my net work issue or some thing else and also it showing in one column not side by side
I believe that you dont have a correct document id in your local. Have you tried to hard code a document there just for testing reasons?
i did it i got the image also
Can you show us what is in local!houses?
sure
tointeger(substitute( substitute( a!queryEntity( entity: cons!SHA_RECORDDOCUMENT, query: a!query( selection: a!querySelection( columns: a!queryColumn( field: "appianDocId" ) ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "entityId", operator: "in", value:ri!entityId ), }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50 ) ), fetchTotalCount: false ).data,"[appianDocId:",""),"]",""))
Is the local!houses list of document ids and the local!listingData array the same length and in the same order?
no they are not of same lenght because for one list data can have more than 2 documents
It's hard when I can't play around with it myself but it looks like your dynamic displaying of cards is based off the number of listings. The way the retrieval of document ids appear to have been implemented you lose the information of which document id belongs to which listing and so would only make sense if it was guaranteed to match in order and length the listings. As this isn't the case I can't see how you can iterate through listings and know which document id image to show.
Could be totally wrong but I feel like you need to retain somehow what document id belongs to which listing in order for this to work.
thank you ajhick for your time and response
It will not solve your problem, but you can simplify this code:
a!queryEntity( entity: cons!SHA_RECORDDOCUMENT, query: a!query( selection: a!querySelection( columns: a!queryColumn( field: "appianDocId" ) ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "entityId", operator: "in", value:ri!entityId ), }, ignoreFiltersWithEmptyValues: true ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 50 ) ), fetchTotalCount: false ).data.appianDocId