function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bertrand C.Bertrand C. 

Files Connect, Chatter REST Api & SharePoint Custom Columns

Hello everyone,

I succesfully setup Files Connect to integrate Salesforce and SharePoint.
I also added custom columns on the SharePoint site and mapped them to Custom Fields of my external object in Salesforce.

I started to experiment new Chatter REST API functionality (Winter 16'), to create a Repository File.
It works only partialy; I can create a Document in SharePoint through the Salesforce API; it requires two steps:
- One POST request to create a SharePoint entity (with no binary)
- One PATCH request to push the binary file into the previously created entity
Maybe it can be done in the same request, if someone succeeded, please let me know that it is feasible.

What i would like to perform is to populate a SharePoint Custom Columns from the API. It doesn't seem to work for now.
Here is the request I am sending:
POST - /services/data/v35.0/connect/content-hub/repositories/[repositoryID]/folders/[folderID]/items
Body
{
"itemTypeId" : "item:L3NpdGVzL2JjaXJvdA:563b414c-1de6-4001-ae98-a152c0af5d66:49dfa557-140c-44d1-b5ab-bbca44429eef:0x0101",
"fields" : [
{
"name" : "name",
"value" : "JustAnotherDocument2.docx"
},
{
"name" : "description",
"value" : "N/A"
},
{
"name" : "AccountId",
"value" : "0018E000005CQfp"
}
]
}

A SharePoint entity is created but AccountId is empty. AccountId is the name of my SharePoint Column that is succesfully mapped to my Salesforce Lookup field.

If someone could help on this, it would be great,
Thank you

Bertrand
JustAGirlyGeekJustAGirlyGeek
This is purely a guess, but try using the 18 character AccountID instead of the 15 character one.
Bertrand C.Bertrand C.
Hi,

Thank you for trying, but it is unfortunately not working.
The REST call is pushing the value in a SharePoint column (Column Type="line of text", length= 18), it will be synched later in the Custom Field after synch has been performed by Salesforce, so I suppose I could event be pushing "JustAGirlyGeek" and it should work ;)

Thank you,
Bertrand
JustAGirlyGeekJustAGirlyGeek
Doh, sorry, coffee hasn't kicked in yet ;) should have realized you were trying to push the value into the target system and not the other way around. If I come across anything I will pass it along.
JustAGirlyGeekJustAGirlyGeek
I don't know the object metadata for the Files Connect but can you try using 'ParentId' instead of 'AccountId'?
Bertrand C.Bertrand C.
Anyone else with a new year brilliant idea ? :)
gary chen.gary chen.
Hi bertrand,

I'm trying to upload files from salesforce workbench and save them into sharepoint, but i don't know the json rules.
There's an arctile about upload files to GoogleDrive from workbench .https://help.salesforce.com/apex/HTViewSolution?id=000230081&language=en_US

I have done it and succeed. What I really want to do is uploading files to sharepoint. Any ideas?
Floris Jan GaleslootFloris Jan Galesloot
Sorry to reply on such an old thread, but I'm trying to do exaclty the same, writing to Custom Columns in Sharepoint. Did you succeed to do so?
Bertrand CIROTBertrand CIROT
Hello Floris,

Salesforce Chatter REST Api is not allowing to push into SharePoint custom columns.
Please vote for this idea to make that possible: https://success.salesforce.com/ideaView?id=08730000000Dzv7AAC
As a workaround, we are passing values in the Title parameter, separated by a specific character (like ";" for example) and then SharePoint split them out in specific columns (Using either Workflows or Calculated Column). 

Hope this helps,
Bertrand
Floris Jan GaleslootFloris Jan Galesloot
Hi Bertrand,

We were explornig the idea of a Workflow in Sharepoint too. Good to know you got this working! I'll vote for the idea.

Thanks!
Floris Jan