REQUIRED_FIELD_MISSING – Missing required input parameter Exception in Salesforce Einstein BOT

REQUIRED_FIELD_MISSING – Missing required input parameter Exception in Salesforce Einstein BOT

REQUIRED_FIELD_MISSING – Missing required input parameter Exception in Salesforce Einstein BOT occurs when the required input parameter is not passed to the Apex Action from the BOT.

Sample Code:

@InvocableVariable( required=true ) 
public String sCaseNumber;

Sample Exception:

errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Missing required input parameter: sCaseNumber","fields":[]}],"isSuccess":false,"outputValues":null}

As per the above exception, the sCaseNumber value is not passed from the Salesforce Einstein BOT to the Apex Class. Since it is a required parameter, it has to be passed.

Resolution:

To fix this issue,

  1. Do a null check in the BOT before calling the Apex Action.
  2. Making required attribute to false is not the solution. Null check using decision element in the Einstein BOT will avoid calling the Apex action unnecessarily without required parameter values.

Leave a Reply