(Salesforce) ContentDocumentId while creating a new ContentVersion

How can i create a new ContentVersion record without supplying a ContentDocumentId? I want Salesforce to create a new ContentDocumentId automatically. Does anyone have an example?

Hi @Jorg_Ackermann ,

How would your workflow / scenario look like? Do you have some examples or screenshots?

The ContentDocumentId is a relationship field which means it needs to be related to a document and always valid by using a lookup. If you want to update the ContentVersion you need the following:

  1. ContentDocumentId
  2. ReasonForChange
  3. PathOnClient (path of the file on the client machine)
  4. VersionData(path of the file on the client machine)

What you could do, is using a lookup of the document first and then updating the version. So within the workflow:

  1. Find the document and its ID
  2. Update the version using the ID earlier found

I would need more details and explanation from you to help you further. Please let me know if you have any more questions.


thank you very much! My requirement is a bit different:

I need to upload a new document, and in this case, the ContentDocument-Record is created automatically by Salesforce. The process is described here:

Content Document:

It represents a document that has been uploaded to a library in Salesforce Files. There is no need to create this object and it automatically gets created when the content version is created.

Best Regards

@Jorg_Ackermann I am still not completely sure what kind of workflow you are looking for.
What do you have now? Or how would you like it to work?

You can always use the: “Make an API call” module. Salesforce also has this, so you can call any kind of API you want.

@Drivn The “Make an API call” module could be a workaround. My workflow is just adding a new file to Salesforce - and in this case, the field “ContentDocumentId” must be omitted, but it is mandatory in the “Create Record”-Module…

I’ve found that utilizing the Make an API Call module is usually the way to go for anything not simple with Salesforce in Make. The API versions are very limited/dated in the modules.