Skip to main content

I’m creating a series of integrations based on Youtube/new video in channel event. Sometimes we are observing missing fields such as thumbnail URLs.

Before applying more complex business logic, such as using Paths to tag videos differently in Ghost based on title, we’d like to ensure that missing fields are populated with default values (such as default image url for missing thumbnails). 

 

How do we achieve that?

Hi @resetobywatelski 

TIP: You can use the .join() method in the JavaScript Code block to combine an array: https://www.w3schools.com/jsref/jsref_join.asp


I’m experimenting with the Code task, which seems to have answered the question. However the problem I’m facing now is that I’m getting an internal server error when attempting to push the post to Ghost

 

Below is the output of my Code (js) task

output = t{
  id: id,            // string
  title: title,      // string
  description:  
  description,  // string
  thumbnail:    
  thumbnail,
  tags: tags.   // array of strings
}];


Will the Ghost task accept the stringh] as a Custom input to it’s tags field? Or does it expect a different input?


Hey @resetobywatelski,

I’m so glad you were able to come up with a solution here, great work! :)

With the second issue, looking at the Create Post action for Ghost it seems that the Tags field requires a list of tags rather than an array:

d02b7fee60eda64b5c2c1bb393487b0a.png
So I’d imagine that a comma separated list of the different tags would work here. Though you’d likely need to ensure that you’re using the ID for the tag rather than it’s name. The ID is usually the value that appears in grey in the dropdown menu, for example: 

8fc20c60513143d6a12c7d258a3b2bb5.png

Hopefully that’ll do the trick!