Document. Attach blob Operation

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

0 votes

1 answers

60 views

ANSWER



Hello,

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:

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;
}

It feels strange to get a blob from a doctype called “New-Workspace” BTW

0 votes