cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

adding custom error messages in custom sdk

kavindu21
Deputy Chef I
Deputy Chef I

How to add validations for the fields here and display error messages when the fields are empty? 

connection: {

  fields: [
    {
      name: "username",
      hint: "Your email used for login"
    },
    {
      name: "password",
      optional: false,
      control_type: "password",
    }
  ],

  authorization: {
    type: "basic_auth",

    credentials: lambda do |connection|
      user(connection["username"])
      password(connection["password"])
    end
  }
}
1 REPLY 1

julie-reyes
Workato employee
Workato employee

Hi,

After reviewing your case, I suggest making the two fields required instead of validating the input upon trying to connect. This will ensure that the connector does not allow the user to connect if the fields are left empty. By making them required, the connector will automatically throw an error when it detects empty values, prompting the user to fill in the necessary information.

I hope this solution will help resolve the issue you are experiencing. If you have any further questions or concerns, please do not hesitate to reach out to us. We are always happy to assist you.

Thank you