a!formLayout( label: "Create Incident Management", contents: { a!boxLayout( label: "Requestor Details", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!textField( label: "Requestor", labelPosition: "ABOVE", value: loggedInUser(), saveInto: {}, refreshAfter: "UNFOCUS", readOnly: true(), validations: {} ) } ), a!columnLayout( contents: { a!textField( label: "Designation", labelPosition: "ABOVE", value: "Project Lead", saveInto: {}, refreshAfter: "UNFOCUS", readOnly: true(), validations: {} ) } ) } ) }, style: "ACCENT" ), ri!subCategory: choose( if(isnull(ri!category),1,ri!category), {"Laptop Issue","Internet Issue"}, {"Cabs Issue","AC Issue"}, {"Salary Issue","Project Allocation Issue"}, {"Finance Planning","Fund Raising"} ), a!sectionLayout( label: "Incident Category", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Category", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: {"IT Support", "Admin Support", "HR Support", "Finance"}, choiceValues: {1,2,3,4}, value : ri!category, saveInto:{ ri!category, a!save(ri!subCategory, null) } /*searchDisplay: "AUTO",*/ /*validations: {}*/ ) } ), a!columnLayout( contents: { a!dropdownField( label: "Sub Category", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels:ri!subCategory, choiceValues:{1}, value: ri!subCategory, saveInto:{ri!subCategory}, disabled: isnull(ri!category), searchDisplay: "AUTO", validations: {} ) } ), a!columnLayout( contents: { a!dateTimeField( label: "Reporting Date and Time", labelPosition: "ABOVE", value: ri!reportingDateTime, saveInto: ri!reportingDateTime, validations: {} ) } ) } ), a!cardLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!textField( label: "Incident Title", labelPosition: "ABOVE", value : ri!incidentTitle, saveInto: {ri!incidentTitle}, refreshAfter: "UNFOCUS", validations: {} ) } ), a!columnLayout( contents: { a!paragraphField( label: "Description", labelPosition: "ABOVE", value: ri!Description, saveInto: ri!Description, refreshAfter: "UNFOCUS", height: "MEDIUM", validations: {} ) } ) } ) }, height: "AUTO", style: "SUCCESS", marginBelow: "STANDARD", showBorder: false() ) } ), a!boxLayout( label: "SLA", style: "ACCENT" ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", submit: true, style: "PRIMARY" ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "NORMAL", validate: false ) } ) )
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!formLayout [line 7]:
Discussion posts and replies are publicly visible
Line 42 is wrong. What is the intention here?
What is wrong you found in line 42?
It seems like you try to assign a value to a rule input. It does not work like this in Appian.
ri!subCategory: choose( if(isnull(ri!category),1,ri!category), {"Laptop Issue","Internet Issue"}, {"Cabs Issue","AC Issue"}, {"Salary Issue","Project Allocation Issue"}, {"Finance Planning","Fund Raising"} ),
docs.appian.com/.../Local_Variables.html
Can you please provide the resolution for this
As I have no idea what you want to achieve.
Please check the linked documentation. Also consider to attend the online trainings to better understand how Appian works.
https://docs.appian.com/suite/help/21.4/Expressions.html
docs.appian.com/.../SAIL_Tutorial.html
Maybe something in line with this might get you started:
a!localVariables( local!availableSubCategories: choose( if(isnull(ri!category),1,ri!category), {"Laptop Issue","Internet Issue"}, {"Cabs Issue","AC Issue"}, {"Salary Issue","Project Allocation Issue"}, {"Finance Planning","Fund Raising"} ), .... <YOUR CODE> a!dropdownFieldByIndex( label: "Sub Category", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels:local!availableSubCategories, value: ri!subCategory, saveInto:{ri!subCategory}, disabled: isnull(ri!category), searchDisplay: "AUTO", validations: {} ) )
Be aware that this is mostly guesswork!
I believe Stefan's suggestion is the right one from the code perspective. One other thing to point out - you define rule inputs entirely separately from expressions via the inputs pane on the right hand side. This then lets you expose these rule inputs outside of your rule to other objects as necessary.
I'd suggest reading this section in particular to understand rule inputs better: docs.appian.com/.../SAIL_Tutorial.html
I would like to achieve cascading drop down values
I would suggest to make your basic concepts clear before achieving anything. The code you have posted its wrong in the very basic. you cant declare ri!ri!subCategory the way you've done in the middle of the code. If you aren't familiar with expresion mode coding, try the drag & drop design mode interface design. also the above suggestions are useful to clear your basic concepts first & then implement something
Another way to put it would be, to get used to coding for basic functionality before trying more advanced functionality. Someone who doesn't actually understand the workings of basic functionality will run into many issues when trying to implement more complex things, based simply on not understaning what's happening in their code - such as what we're seeing in this example.