Loading

Data Mapper Extract Does Not Fetch Expected Value on Custom Field

게시 일자: Jul 19, 2024
상세 설명

When an object has the same API name for two fields, ignoring namespace, the data from the custom field is not fetched by the Data Mapper.

Example:
Managed package Custom field:{namespace}__Email__c
Custom field: Email__c

Even when an object record has a value for the custom field (Email__c in this case), the Data Mapper fetches a ‘null’ value. Since the default behavior of the Data Mapper is to ignore the ‘null’ values, the ‘Response’ will not have the attribute set on the output JSON path.

솔루션

Salesforce uses ‘__c’ to indicate a field is a custom field. Regardless of adding namespace, it is not good practice to use the same API name for fields. API names should be completely unique. It's advisable to avoid using naming conventions that the backend system will automatically generate, as this can lead to conflicts and unintended behaviors.

If the above recommendation is not an option, check the following to mitigate the issue:

1. Rename the custom `Field Label/Name` to generate an unique `API Name`. This is straight forward and the easiest way to resolve the issue. However, sometimes this option is not viable due to the field being used in various API's or Integrations. In such scenarios, opt for the 2nd option below.

2. Create a new field on the Object itself with a
`Formula` data type
`Text` return type
Note: This can vary depending on your requirements.
Formula being the custom field itself (like Email__c)
Note: This can vary depending on your requirements.
Fill in the remaining details as needed for `Field-level Security` and `Page Layouts`.
After creating the field as in Step #2, map the `EXTRACT JSON PATH` on to the new field in the DataRaptor.

Knowledge 기사 번호

000393901

 
로드 중
Salesforce Help | Article