<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Document. Attach blob Operation in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/document-attach-blob-operation/m-p/321692#M8693</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Your error is server side, so the browser logs don't help a lot. I really not recommend using automation chain for this use case, it makes things complex. You'd better go with automation scripting. It should be something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function run(input, params) {
  var parent_doc = Document.GetParent(
    input, {
      'type': "New-Workspace"
    }
  );
  var file = Document.GetBlob(
    input, {
      /*required:false - type: string*/
      'xpath': "file:content"
    }
  );
  Blob.AttachOnDocument(
    file, {
      /*required:true - type: document*/
      'document': input,
      /*required:false - type: boolean*/
      'save': true,
      /*required:false - type: string*/
      'xpath': "project:logo"
    }
  );
  return input;
}

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It feels strange to get a blob from a doctype called "New-Workspace" BTW&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2021 12:35:34 GMT</pubDate>
    <dc:creator>Gregory_Carlin</dc:creator>
    <dc:date>2021-05-27T12:35:34Z</dc:date>
    <item>
      <title>Document. Attach blob Operation</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/document-attach-blob-operation/m-p/321691#M8692</link>
      <description>&lt;P&gt;Hi,
I want to get a file from an existing document  (Type: New-Workspace) and to attach it to another document (Type: Project) using an automation chain ( Please see attached document)
when I create a new project I receive an error message (Please See attachment : console )
Could you please help me to find possible causes
Thankyou&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 11:39:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/document-attach-blob-operation/m-p/321691#M8692</guid>
      <dc:creator>Wafa_SELLEMI</dc:creator>
      <dc:date>2021-05-27T11:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Document. Attach blob Operation</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/document-attach-blob-operation/m-p/321692#M8693</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Your error is server side, so the browser logs don't help a lot. I really not recommend using automation chain for this use case, it makes things complex. You'd better go with automation scripting. It should be something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;function run(input, params) {
  var parent_doc = Document.GetParent(
    input, {
      'type': "New-Workspace"
    }
  );
  var file = Document.GetBlob(
    input, {
      /*required:false - type: string*/
      'xpath': "file:content"
    }
  );
  Blob.AttachOnDocument(
    file, {
      /*required:true - type: document*/
      'document': input,
      /*required:false - type: boolean*/
      'save': true,
      /*required:false - type: string*/
      'xpath': "project:logo"
    }
  );
  return input;
}

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It feels strange to get a blob from a doctype called "New-Workspace" BTW&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 12:35:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/document-attach-blob-operation/m-p/321692#M8693</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2021-05-27T12:35:34Z</dc:date>
    </item>
  </channel>
</rss>

