Sample Salesforce External Object Qualifier for Amazon AWS DynamoDB

Sample Salesforce External Object Qualifier for Amazon AWS DynamoDB

Qualifiers an be used parse or transform data returned from the Amazon DynamoDB.

Using the following External Object Qualifier, Sample_Qualifier_Field value will be automatically populated. As per the definition, it is PK + SK which means concatenation of PK and SK field values.

Sample External Object Qualifier:

{
  "tableName": "Test",
  "columns": {
    "Sample_Qualifier_Field": {
      "type": "S",
      "values": [
        {
          "definition": "PK + SK"
        }
      ]
    } 
  }
}

Sample Apex Code:

Test__x objTest = new Test__x();
objTest.PK__c = '7';
objTest.SK__c = 'Test7';
objTest.Name__c = 'Test7';
Database.SaveResult objSR = Database.insertImmediate( 
    objTest 
);
System.debug( 'Created successfully? ' + objSR.isSuccess() );
if ( objSR.isSuccess() ) {
    
    System.debug( 'Record Id is ' + objSR.getId() );
    
}

Output:

Leave a Reply