none
Workflow to chage doc.lib column default value in other sitecollection RRS feed

  • Question

  • Hi,

    Is it possible to make a workflow that chages a columns default value for a document library in another sitecollection?

    If so - how?


    jik

    Friday, February 17, 2017 9:52 AM

Answers

  • Hi jik,

    Can you list the steps in details(screenshot would be better) about how you do the test in your two site collections?

    Following that demo, I can see that the item created successfully in my another site collection.

    To narrow down the issue, I would suggest you follow the demo provided in my last reply about create item in another site collection, once it works, then try calling other REST endpoints afterwards.

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by JIK12 Tuesday, February 28, 2017 12:17 PM
    Wednesday, February 22, 2017 6:54 AM
    Moderator

All replies

  • If you use SharePoint 2010 workflows it is not possible

    If you use SharePoint 2013 the doing it via web service calls might be possible

    https://msdn.microsoft.com/en-us/library/office/dn567558.aspx

    or Visual Studio workflows can do that

    Thanks

    Kislay

    Mark as answer if it helps you

    Friday, February 17, 2017 1:42 PM
  • Thanks,

    I'm using SP Online.

    Tried with Designer based on your link and a sample javascript-code, but it gives errors.

    Have searched for workflow samples without any hits.


    jik

    Monday, February 20, 2017 6:08 AM
  • Hi jik,

    With SharePoint Designer workflow and SharePoint REST web service, you can achieve what you request.

    There will be two main steps to implement such a workflow:

    1, assign elevated permission to this workflow to make it able to manage resources in another site collection;

    2, call the corresponding service endpoint to manage the list field property;

    This article is about how to create item in other site collection, it contains the steps to “assign elevated permission to this workflow to make it able to manage resources in another site collection”:

    http://blog.portiva.nl/2016/11/03/sharepoint-designer-call-http-web-service-to-create-item-in-other-site-collection/

    This is the corresponding service endpoint for list field which can be used to manage the properties of a field:

    https://msdn.microsoft.com/en-us/library/office/dn600182.aspx#bk_Field

    Please let me know if there still any doubt about it.

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, February 20, 2017 7:00 AM
    Moderator
  • Thanks,

    I've tried to make a workflow fron this description.

    T.ex changing the column title.

    It gives me an error message I haven't found the answere to. (also tried to change the sample to set the columns default value):

    REST:

    https://tenant.sharepoint.com/sites/sitecoll/site/_api/web/lists/getbytitle('Documents')/fields/getbyTitle('Fieldname')

    RequestHeader:

    {"Content-Type":"application\/json;odata=verbose","X-HTTP-Method":"MERGE","Accept":"application\/json;odata=verbose"}

    RequestDictionary:

    {"data":{"__metadata":{"type":"SP.Field"},"DefaultValue":"NewValue"}}

    ----

    {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"nb-NO","value":"An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified."}}}

    ResponseHeader:

    {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"X-SP-SERVERSTATE":["ReadOnly=0"],"DATASERVICEVERSION":["3.0"],"SPClientServiceRequestDuration":["177"],"SPRequestDuration":["268"],"SPRequestGuid":["7d1dc1f5-022c-6340-a935-c408c25b1823"],"request-id":["7d1dc1f5-022c-6340-a935-c408c25b1823"],"Strict-Transport-Security":["max-age=31536000"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["16.0.0.6209"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Mon, 20 Feb 2017 13:21:53 GMT"],"P3P":["CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\""],"Server":["Microsoft-IIS\/8.5"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]}

    ResponseCode:

    BadRequest

    I made a javascript that works well. But I need a workflow...

    Using

    https://tenant.sharepoint.com/sites/sitecoll/site/_api/web/lists/getbytitle('Documents')/fields/getbyTitle('Fieldname')/DefaultValue

    in browser gives the fields defailt value...

    Any obvious errors?


    jik

    Monday, February 20, 2017 7:19 PM
  • Hi jik,

    Can you list the steps in details(screenshot would be better) about how you do the test in your two site collections?

    Following that demo, I can see that the item created successfully in my another site collection.

    To narrow down the issue, I would suggest you follow the demo provided in my last reply about create item in another site collection, once it works, then try calling other REST endpoints afterwards.

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by JIK12 Tuesday, February 28, 2017 12:17 PM
    Wednesday, February 22, 2017 6:54 AM
    Moderator
  • Hi jik,

    Just want to know how is the thing going now?

    Best regards,

    Patrick


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, February 24, 2017 9:41 AM
    Moderator
  • Hi, and thanks.

    I'll do a new test with the excact same code as the sample, and if that works I'll try to change to set the default value. Hope get it done today. I'll let you know.


    jik

    Monday, February 27, 2017 6:49 AM
  • Hi,

    got it!

    Tried your sample first, and it worked. Thereafter changed code to set the default value of a column.


    jik

    Tuesday, February 28, 2017 12:17 PM