2

We have a NodeJS application which receives & sends data to Postgres database. The Postgres database is in sync with salesforce object through Heroku connect. The JSON that we need to send to salesforce contains more than 1,638,400 characters (1,638,400 is the standard large text field limit).

How can we store/process a JSON payload of this size in salesforce.

2
  • Store in multiple fields or, maybe store in file/attach with the record, just a suggestion. Commented Mar 1, 2021 at 11:01
  • You can store up to 2GB in a File but I don't know if Heroku Connect can use them. But Apex limits will stop you doing processing in Salesforce, and Evergreen isn't GA yet.
    – Keith C
    Commented Mar 1, 2021 at 11:54

1 Answer 1

2

I build an app that does something similar - it passes in 200 records at at a time in a JSON array to be processed, and many of those records have long text descriptions as part of the data so are too big for a long text field.

So we have a staging object with a fields on it like status, type, and then the inbound request comes to a custom Apex REST endpoint that creates a staging record and then just creates a regular attachment with the inbound JSON payload for that staging record.

When the inbound process is complete, the final post to the endpoint says 'load complete', and we kick off an apex batch process that iterates through the staging records with their attachments, de-serializes the JSON into an Apex Class, and then convert the records into their target objects (Contacts, Custom Objects). Any errors are just written back to the staging object, and once the process is complete, all successful records are just deleted via a follow up batch.

1
  • Do you have a github example? Commented Jul 20, 2022 at 12:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .