Getting a strange error:
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!gridLayout [line 6]: Rule 'l' has 1 parameters, but instead passed 0 parameters.
Attaching the code for review.a!localVariables( a!formLayout( label: "Create New Request", instructions: "Create a new Request Type|Maximum 5 requests can be created at a time", contents: { a!gridLayout( totalCount: count( ri!requestTypeRef ), headerCells: { a!gridLayoutHeaderCell( label: "Request Type*" ), a!gridLayoutHeaderCell( label: "Item*" ), a!gridLayoutHeaderCell( label: "Quantity*" ), a!gridLayoutHeaderCell( label: "Price ($)*" ), a!gridLayoutHeaderCell( label: "Comment*", align: "RIGHT" ), a!gridLayoutHeaderCell( label: "" ) }, columnConfigs: { a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 2 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 2 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 1 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 1 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 2 ), a!gridLayoutColumnConfig( width: "ICON" ) }, rows: a!forEach( items: ri!requestTypeRef, expression: a!gridRowLayout( id: fv!index, contents: { a!dropdownField( label: "request type " & fv!index, placeholderLabel: "---Please select value---", choiceLabels: cons!OSR_TEXT_ARRAY_REQUEST_TYPE, choiceValues: cons!OSR_TEXT_ARRAY_REQUEST_TYPE, value: index(fv!item, "RequestTypeName", {}), saveInto: fv!item.RequestTypeName, required: true ), a!textField( label: "item " & fv!index, value: if( ri!requestTypeRef[fv!index].RequestTypeName = "Service", index( ri!serviceTypeRef[fv!index], "ServiceTypeName", {} ), index( ri!supplyTypeRef[fv!index], "SupplyTypeName", {} ) ), saveInto: if( ri!requestTypeRef[fv!index].RequestTypeName = "Service", ri!serviceTypeRef[fv!index].ServiceTypeName, ri!supplyTypeRef[fv!index].SupplyTypeName ), required: true ), a!integerField( label: "quantity " & fv!index, value: index( ri!request[fv!index], "Quantity", {} ), saveInto: ri!request[fv!index].Quantity, required: true ), a!floatingPointField( label: "price " & fv!index, value: todecimal( index( ri!request[fv!index], "Price", {} ) ), saveInto: ri!request[fv!index].Price, required: true ), a!paragraphField( label: "comment " & fv!index, value: index( ri!comment[fv!index], "Comment", {} ), saveInto: ri!comment[fv!index].Comment, required: true ), a!imageField( label: "delete " & fv!index, images: a!documentImage( document: a!iconIndicator( "REMOVE" ), altText: "Remove Request", caption: "Remove ", link: a!dynamicLink( value: fv!index, saveInto: { a!save( ri!request, remove( ri!request, save!value ) ), a!save( ri!requestTypeRef, remove( ri!requestTypeRef, save!value ) ), a!save( ri!serviceTypeRef, remove( ri!serviceTypeRef, save!value ) ), a!save( ri!supplyTypeRef, remove( ri!supplyTypeRef, save!value ) ), a!save( ri!comment, remove( ri!comment, save!value ) ) } ) ), size: "ICON" ) } ) ), addRowlink: a!dynamicLink( label: "Add New Request", value: null, showWhen: count( ri!requestTypeRef ) < 5, saveInto: { a!save( ri!request, append( ri!request, save!value ) ), a!save( ri!requestTypeRef, append( ri!requestTypeRef, save!value ) ), a!save( ri!serviceTypeRef, append( ri!serviceTypeRef, save!value ) ), a!save( ri!supplyTypeRef, append( ri!supplyTypeRef, save!value ) ), a!save( ri!comment, append( ri!comment, save!value ) ) } ), rowHeader: 1, validations: { a!forEach( items: ri!requestTypeRef, expression: if( or( isnull( ri!requestTypeRef[fv!index].RequestTypeName ), isnull( ri!request[fv!index].Quantity ), isnull( ri!request[fv!index].Price ), isnull( ri!comment[fv!index].Comment ) ), a!validationMessage( message: "Please fill all the Required* fields!", validateAfter: "SUBMIT" ), {} ) ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: cons!OSR_TEXT_BUTTON_SUBMIT, submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: cons!OSR_TEXT_BUTTON_CANCEL, value: true, saveInto: ri!cancel, submit: true, style: "NORMAL" ) } ) ) )
a!localVariables( a!formLayout( label: "Create New Request", instructions: "Create a new Request Type|Maximum 5 requests can be created at a time", contents: { a!gridLayout( totalCount: count( ri!requestTypeRef ), headerCells: { a!gridLayoutHeaderCell( label: "Request Type*" ), a!gridLayoutHeaderCell( label: "Item*" ), a!gridLayoutHeaderCell( label: "Quantity*" ), a!gridLayoutHeaderCell( label: "Price ($)*" ), a!gridLayoutHeaderCell( label: "Comment*", align: "RIGHT" ), a!gridLayoutHeaderCell( label: "" ) }, columnConfigs: { a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 2 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 2 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 1 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 1 ), a!gridLayoutColumnConfig( width: "DISTRIBUTE", weight: 2 ), a!gridLayoutColumnConfig( width: "ICON" ) }, rows: a!forEach( items: ri!requestTypeRef, expression: a!gridRowLayout( id: fv!index, contents: { a!dropdownField( label: "request type " & fv!index, placeholderLabel: "---Please select value---", choiceLabels: cons!OSR_TEXT_ARRAY_REQUEST_TYPE, choiceValues: cons!OSR_TEXT_ARRAY_REQUEST_TYPE, value: index(fv!item, "RequestTypeName", {}), saveInto: fv!item.RequestTypeName, required: true ), a!textField( label: "item " & fv!index, value: if( ri!requestTypeRef[fv!index].RequestTypeName = "Service", index( ri!serviceTypeRef[fv!index], "ServiceTypeName", {} ), index( ri!supplyTypeRef[fv!index], "SupplyTypeName", {} ) ), saveInto: if( ri!requestTypeRef[fv!index].RequestTypeName = "Service", ri!serviceTypeRef[fv!index].ServiceTypeName, ri!supplyTypeRef[fv!index].SupplyTypeName ), required: true ), a!integerField( label: "quantity " & fv!index, value: index( ri!request[fv!index], "Quantity", {} ), saveInto: ri!request[fv!index].Quantity, required: true ), a!floatingPointField( label: "price " & fv!index, value: todecimal( index( ri!request[fv!index], "Price", {} ) ), saveInto: ri!request[fv!index].Price, required: true ), a!paragraphField( label: "comment " & fv!index, value: index( ri!comment[fv!index], "Comment", {} ), saveInto: ri!comment[fv!index].Comment, required: true ), a!imageField( label: "delete " & fv!index, images: a!documentImage( document: a!iconIndicator( "REMOVE" ), altText: "Remove Request", caption: "Remove ", link: a!dynamicLink( value: fv!index, saveInto: { a!save( ri!request, remove( ri!request, save!value ) ), a!save( ri!requestTypeRef, remove( ri!requestTypeRef, save!value ) ), a!save( ri!serviceTypeRef, remove( ri!serviceTypeRef, save!value ) ), a!save( ri!supplyTypeRef, remove( ri!supplyTypeRef, save!value ) ), a!save( ri!comment, remove( ri!comment, save!value ) ) } ) ), size: "ICON" ) } ) ), addRowlink: a!dynamicLink( label: "Add New Request", value: null, showWhen: count( ri!requestTypeRef ) < 5, saveInto: { a!save( ri!request, append( ri!request, save!value ) ), a!save( ri!requestTypeRef, append( ri!requestTypeRef, save!value ) ), a!save( ri!serviceTypeRef, append( ri!serviceTypeRef, save!value ) ), a!save( ri!supplyTypeRef, append( ri!supplyTypeRef, save!value ) ), a!save( ri!comment, append( ri!comment, save!value ) ) } ), rowHeader: 1, validations: { a!forEach( items: ri!requestTypeRef, expression: if( or( isnull( ri!requestTypeRef[fv!index].RequestTypeName ), isnull( ri!request[fv!index].Quantity ), isnull( ri!request[fv!index].Price ), isnull( ri!comment[fv!index].Comment ) ), a!validationMessage( message: "Please fill all the Required* fields!", validateAfter: "SUBMIT" ), {} ) ) } ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: cons!OSR_TEXT_BUTTON_SUBMIT, submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: cons!OSR_TEXT_BUTTON_CANCEL, value: true, saveInto: ri!cancel, submit: true, style: "NORMAL" ) } ) ) )
Thanks
Discussion posts and replies are publicly visible
Found the resolution, so closing the issue. On debugging, problem was with validation code
validations: { a!forEach( items: ri!requestTypeRef, expression: if( or( isnull( ri!requestTypeRef[fv!index].RequestTypeName ), isnull( ri!request[fv!index].Quantity ), isnull( ri!request[fv!index].Price ), isnull( ri!comment[fv!index].Comment ) ), a!validationMessage( message: "Please fill all the Required* fields!", validateAfter: "SUBMIT" ), "replaced {} with a!validationMessage()" )
On following the exact SAIL Recipe for validations... "Showing Validation Errors that Aren't Specific to One Component", I found that Appian gives error on using blank braces, something needs to be there, either an empty string "" but not {}, it was weird and time consuming.
varunkumarb0001 Thanks for the detailed explanation. I was also facing the same issue. It helped me a lot
thank you for sharing :)