Hi Guys.
I am facing interface error when user enters not valid details while creating user using createUser(). and also if user enters userID which is already present it is througing error.
Please give me your input here to resolve the issue.
Thanks in advance.
Please find the attached code.
= a!localVariables( local!success, local!error: false, local!firstName, local!btnAction, local!lastname, local!email, local!userName, a!sectionLayout( contents: { a!sideBySideLayout( items: { a!sideBySideItem( item: a!textField( label: " ", labelPosition: "JUSTIFIED", value: local!success, saveInto: local!success, readOnly: true(), validations: if( local!error, " Please provide valid detail", "" ), ), width: "MINIMIZE" ) } ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!textField( label: "User Name ", labelPosition: "JUSTIFIED", value: local!userName, saveInto: local!userName, validations: if( local!error, "Please provide valid detail", "" ), ), width: "MINIMIZE" ) } ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!textField( label: "First Name", labelPosition: "JUSTIFIED", value: local!firstName, saveInto: local!firstName, validations: if( local!error, "Please provide valid detail", "" ) ), width: "MINIMIZE" ) } ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!textField( label: "Last Name", labelPosition: "JUSTIFIED", validations: if( local!error, "Please provide valid detail", "" ), value: local!lastname, saveInto: local!lastname, ), width: "MINIMIZE" ) } ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!textField( label: "Email Id ", labelPosition: "JUSTIFIED", value: local!email, saveInto: local!email, validations: if( local!error, "Please provide valid detail", "" ), ), width: "MINIMIZE" ) } ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Create", value: "create", saveInto: { local!btnAction, a!createUser( username: local!userName, firstName: local!firstName, lastName: local!lastname, email: local!email, onSuccess: { a!save( local!success, "User Created successfully" ), a!save(local!error, false) }, onError: { a!save(local!error, true), } ), a!save(local!userName, null), a!save(local!lastname, null), a!save(local!firstName, null), a!save(local!email, null), } ), a!buttonWidget( label: "Cancel", value: "cancelCreate", saveInto: local!btnAction ) }, align: "START" ) }, ) )
Discussion posts and replies are publicly visible
What you are seeing is the common error when a smart service hits an error in Interface Designer. To avoid this specific error, I recommend adding a validation to your text field using the function isusernametaken https://docs.appian.com/suite/help/20.3/fnc_people_isusernametaken.html
I got it.
Thank you :) Danny Verb