Hi community,
I've just started exploring the Appian. I'm trying to create a new vehicle form based on the tutorials, but the form inputs are being cleared when clicking outside of the input fields.
This is the code
a!localVariables( a!headerContentLayout( header: a!cardLayout( contents: { a!headingField( text: "Create Vehicle", size: "LARGE", fontWeight: "SEMI_BOLD" ), a!richTextDisplayField( labelPosition: "COLLAPSED", value: { "Enter vehicle details" } ) }, style: "ACCENT", padding: "STANDARD", showBorder: false ), isHeaderFixed: true, contents: { a!columnsLayout( columns: { a!columnLayout( showWhen: a!isPageWidth( { "DESKTOP_WIDE", "DESKTOP", "DESKTOP_NARROW", "TABLET_LANDSCAPE" } ) ), a!columnLayout( contents: { a!sectionLayout( contents: { a!cardLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: a!textField( label: "Make", labelPosition: "ABOVE", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{59149532-32a0-4609-acbe-bb81047aee2b}make'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{59149532-32a0-4609-acbe-bb81047aee2b}make'], characterLimit: 55, showCharacterCount: false, required: true, marginAbove: "NONE" ) ), a!columnLayout( contents: a!textField( label: "Model", labelPosition: "ABOVE", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{300834dd-0779-4500-a16c-9b5d9dbd53cb}model'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{300834dd-0779-4500-a16c-9b5d9dbd53cb}model'], characterLimit: 55, showCharacterCount: false, required: true, marginAbove: "NONE" ) ), a!columnLayout( contents: a!integerField( label: "Year", labelPosition: "ABOVE", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{4b54053a-52f0-4ba7-8bf5-6d6c62e696bb}year'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{4b54053a-52f0-4ba7-8bf5-6d6c62e696bb}year'], required: true, marginAbove: "NONE" ) ) } ), a!columnsLayout( columns: { a!columnLayout( contents: a!textField( label: "Color", labelPosition: "ABOVE", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{afa2c85b-1224-4607-a927-d8b82ddb21b7}color'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{afa2c85b-1224-4607-a927-d8b82ddb21b7}color'], characterLimit: 55, showCharacterCount: false, required: false, marginAbove: "STANDARD" ) ), a!columnLayout( contents: a!textField( label: "Vin", labelPosition: "ABOVE", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{80b49d9b-adac-4c25-b805-63791e17e9d8}vin'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{80b49d9b-adac-4c25-b805-63791e17e9d8}vin'], characterLimit: 17, showCharacterCount: false, required: true, marginAbove: "LESS" ) ), a!columnLayout( contents: a!integerField( label: "Mileage", labelPosition: "ABOVE", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{df789221-fbf0-4a21-9a2a-f50021fb3b71}addedOn'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{df789221-fbf0-4a21-9a2a-f50021fb3b71}addedOn'], required: true, validations: { null }, marginAbove: "LESS" ) ) } ), a!columnsLayout( columns: { a!columnLayout( contents: a!dropdownField( data: 'recordType!{4ffe7304-b1ec-4920-93fa-c7eb61cfecbf}FM Vehicle Condition', choiceLabels: 'recordType!{4ffe7304-b1ec-4920-93fa-c7eb61cfecbf}FM Vehicle Condition.fields.{0866076e-077a-4a4a-84a9-2018599c7128}value', choiceValues: 'recordType!{4ffe7304-b1ec-4920-93fa-c7eb61cfecbf}FM Vehicle Condition.fields.{5094d28f-54e9-45ea-89df-861b04d441de}id', sort: { a!sortInfo( field: 'recordType!{4ffe7304-b1ec-4920-93fa-c7eb61cfecbf}FM Vehicle Condition.fields.{67ad8794-3f2b-4516-ac02-a038e81fceab}order', ascending: true ) }, label: "Condition", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{1ae37815-1155-4399-9926-bc959d554c29}conditionId'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{1ae37815-1155-4399-9926-bc959d554c29}conditionId'], required: true, requiredMessage: "Please select a condition", marginAbove: "LESS" ) ), a!columnLayout( contents: a!dropdownField( data: 'recordType!{50978884-4ce7-4550-9d6b-fb143c17a886}FM Vehicle Status', choiceLabels: 'recordType!{50978884-4ce7-4550-9d6b-fb143c17a886}FM Vehicle Status.fields.{f8dde8a8-7a13-4440-b9c3-c8f067d49164}value', choiceValues: 'recordType!{50978884-4ce7-4550-9d6b-fb143c17a886}FM Vehicle Status.fields.{1bbaf7f9-b80f-4091-b867-a30ff0309f80}id', sort: { a!sortInfo( field: 'recordType!{50978884-4ce7-4550-9d6b-fb143c17a886}FM Vehicle Status.fields.{7bf47e9d-bb2c-4b9a-9303-3cf029206080}order', ascending: true ) }, label: "Status", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{fb9757ed-8bf9-4e35-8040-a538b8eedb12}statusId'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{fb9757ed-8bf9-4e35-8040-a538b8eedb12}statusId'], required: true, marginAbove: "LESS" ) ), a!columnLayout( contents: a!dropdownField( data: 'recordType!{b44f6b26-a8c4-47a6-a311-e2e3e339ffe4}FM Vehicle Category', choiceLabels: 'recordType!{b44f6b26-a8c4-47a6-a311-e2e3e339ffe4}FM Vehicle Category.fields.{71fdeb67-4733-4d1e-afb3-c60f85649565}value', choiceValues: 'recordType!{b44f6b26-a8c4-47a6-a311-e2e3e339ffe4}FM Vehicle Category.fields.{c5f513fe-fe52-4313-a59d-c95e42c1cdfd}id', label: "Category", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{e497e06e-24aa-42ca-be18-1af8c92fdda3}categoryId'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{e497e06e-24aa-42ca-be18-1af8c92fdda3}categoryId'], required: true, marginAbove: "LESS" ) ) } ), a!columnsLayout( columns: { a!columnLayout( contents: { a!fileUploadField( label: "File Upload", labelPosition: "COLLAPSED", placeholder: "", target: cons!FM_PTR_VEHICLE_IMAGE_FOLDER, value: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{75e70c53-e96d-4fa1-88b5-2b39b5f61a58}image'], saveInto: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{75e70c53-e96d-4fa1-88b5-2b39b5f61a58}image'] ) } ) } ) }, style: "NONE", shape: "SEMI_ROUNDED", padding: "MORE" ) }, marginBelow: "MORE" ), a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Create", saveInto: { a!save( target: ri!vehicle['recordType!{38ed183d-4364-4e87-bb48-1e4e427ed67a}FM Vehicle.fields.{4311bc29-fb62-467b-bd97-dc9c00b8b7b6}addedBy'], value: loggedInUser() ), a!save( target: ri!vehicle['recordType!{e1f9ebfa-9ab7-4391-aa9c-0ec2674b3709}APPTUT AA Vehicle.fields.{6818a817-aa4e-4af4-851f-fe84b0984e08}createdOn'], value: now() ) }, submit: true, style: "SOLID", validate: true ) }, secondaryButtons: { a!buttonWidget( label: "Cancel", value: true, saveInto: ri!cancel, submit: true, style: "OUTLINE", validate: false ) } ) }, width: "WIDE" ), a!columnLayout( showWhen: a!isPageWidth( { "DESKTOP_WIDE", "DESKTOP", "DESKTOP_NARROW", "TABLET_LANDSCAPE" } ) ) } ) }, backgroundColor: "#fbfbfb" ) )
and this is the issue i'm having
Can anyone help?
Discussion posts and replies are publicly visible
Hi flaviom128453
The issue you're encountering is likely due to the input values not being properly persisted. To resolve this, ensure each input field is correctly bound to the rule input using both the value and saveInto parameters, like so:value: ri!vehicle.vehicleMake_txt, saveInto: ri!vehicle.vehicleMake_txt
value
saveInto
Additionally, please verify that ri!vehicle is defined as a record type rule input (e.g., of type Vehicle) rather than a plain text or dictionary. This ensures that data binding and updates function correctly across the form.Let me know if any of this helps.
ri!vehicle
Vehicle