Skip to main content
Question

SharePointOnineConnector - Custom columns

  • September 17, 2020
  • 5 replies
  • 41 views

roberto
Contributor
Forum|alt.badge.img+6

Hi,

I'm performing some tests with the SharePointOnlineConnector. It works well uploading files. I'm not able to write some fields in the document library. Do you think it is possible? If yes, how to do it?

Thanks

Roberto

5 replies

david_r
Celebrity
  • September 17, 2020

For custom columns you'll have to write the metadata manually using the HTTPCaller with authentication set to an MS Graph web connection (that you'll have to configure first).

You'll then want to use the PATCH method on a URL that looks like this:

https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/<listitemid>/fields

The message body should contain a JSON document describing the values you want to set, see: https://docs.microsoft.com/en-us/graph/api/listitem-update?view=graph-rest-1.0&tabs=http

I believe that the SharepointOnlineConnector will let you retrieve these IDs from the output port after uploading the file.

This is for updating "regular" column values, if have managed metadata columns, then that's a fair bit more complex.


roberto
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • September 17, 2020
david_r wrote:

For custom columns you'll have to write the metadata manually using the HTTPCaller with authentication set to an MS Graph web connection (that you'll have to configure first).

You'll then want to use the PATCH method on a URL that looks like this:

https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/<listitemid>/fields

The message body should contain a JSON document describing the values you want to set, see: https://docs.microsoft.com/en-us/graph/api/listitem-update?view=graph-rest-1.0&tabs=http

I believe that the SharepointOnlineConnector will let you retrieve these IDs from the output port after uploading the file.

This is for updating "regular" column values, if have managed metadata columns, then that's a fair bit more complex.

Thanks @david_r,

I'll work on that solution and let you know.

Regards

Roberto


roberto
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • September 23, 2020
david_r wrote:

For custom columns you'll have to write the metadata manually using the HTTPCaller with authentication set to an MS Graph web connection (that you'll have to configure first).

You'll then want to use the PATCH method on a URL that looks like this:

https://graph.microsoft.com/v1.0/sites/<siteid>/lists/<listid>/items/<listitemid>/fields

The message body should contain a JSON document describing the values you want to set, see: https://docs.microsoft.com/en-us/graph/api/listitem-update?view=graph-rest-1.0&tabs=http

I believe that the SharepointOnlineConnector will let you retrieve these IDs from the output port after uploading the file.

This is for updating "regular" column values, if have managed metadata columns, then that's a fair bit more complex.

Hello @david_r​ ,

I'm trying to follow your hint. Creating a new web connection (Microsoft OneDrive - Graph) with my credentials and building the url with list_id and item_id out from the  SharePointOnlineConnector transformer, I always receive the error 'HTTP/1.1 404 Not Found'. Navigating the url that is shown close to the error, I see a response with "code":"InvalidAuthenticationToken" and "message":"Access token is empty". 

Any further suggestion?

TIA

Roberto


david_r
Celebrity
  • September 23, 2020
roberto wrote:

Hello @david_r​ ,

I'm trying to follow your hint. Creating a new web connection (Microsoft OneDrive - Graph) with my credentials and building the url with list_id and item_id out from the SharePointOnlineConnector transformer, I always receive the error 'HTTP/1.1 404 Not Found'. Navigating the url that is shown close to the error, I see a response with "code":"InvalidAuthenticationToken" and "message":"Access token is empty".

Any further suggestion?

TIA

Roberto

I suspect that you shouldn't be using the MS OneDrive connection. If you haven't already, try installing and configuring this web connection:

https://hub.safe.com/publishers/gerhardatsafe/web-connections/microsoft-graph

Don't forget to replace the Client ID and Client Secret with your own values, as defined in the Sharepoint console when granting API access.


roberto
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • October 6, 2020
roberto wrote:

Hello @david_r​ ,

I'm trying to follow your hint. Creating a new web connection (Microsoft OneDrive - Graph) with my credentials and building the url with list_id and item_id out from the SharePointOnlineConnector transformer, I always receive the error 'HTTP/1.1 404 Not Found'. Navigating the url that is shown close to the error, I see a response with "code":"InvalidAuthenticationToken" and "message":"Access token is empty".

Any further suggestion?

TIA

Roberto

Hello @david_r​ ,

maybe I need more expertize on graph concept. I configured the fme_graph web connection with the information needed. But, for sure with some errors. Testing the connection, it seems that the token retrieval is fine but not the token refresh.

Capture1

Maybe the redirect_uri?

Thanks

Regards

Roberto


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings