Hey all,
Adding my vote to this, but also adding a half-way solution I stumbled across as I was fiddling.
The note body can be altered by HTML, so I tested the creation of a note activity using a custom code action (Req Opshub) - I dropped a html table in for use in the note body. Testing the code below returned this result:
So no borders by the looks of it, but it does seem to add some formatting in. I’ll probably just add a | in between the columns for my use case. Hopefully this’ll helps some of you out there!
const axios = require('axios');
exports.main = async (event) => {
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.INSERTTOKENHERE}`
}
var text = `
<table border="1" cellpadding="5" style="border-color: black;">
<tbody>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td>Text 1</td>
<td>Text 2</td>
</tr>
</tbody>
</table>
`;
let body = text;
axios.post('https://api.hubapi.com/crm/v3/objects/notes', {
"properties": {
"hs_timestamp": Date.now(), // Current time/date
"hs_note_body": body, // Body of the note
}
}, {
"headers": headers
})
.then(function(response) {
//2. Associate Engagement to the currently enrolled object.
var engagementID = response.data.id;
axios({
method: 'put',
url: 'https://api.hubapi.com/crm/v3/objects/notes/' + engagementID + '/associations/ticket/' + event.object.objectId + '/note_to_ticket',
headers: headers
})
.then(function(res) {
console.log("RESPONSE: " + JSON.stringify(res.data))
})
.catch(err => {
console.log('Error: ' + err.message);
})
})
.catch(err => {
console.log('Error: ' + err.message);
});
}
