Perry Auld
11/13/2024, 6:41 PMCeligo AI
11/13/2024, 6:42 PMAI generated answer (using internal Slack threads):Based on the conversations, the
UNSUPPORTED_DATA_FORMAT error occurs when you are trying to pass an array or a string to the addCustomDataSource method of the render module in SuiteScript. This method expects an object, not an array or a string.
Here is an example of how to correctly use the addCustomDataSource method:
javascript
renderer.addCustomDataSource({
format: render.DataSource.OBJECT,
alias: 'results',
data: {results: [{custrecord_lpn_parent : 'LPN00000001'}]}
});
In this example, the data property is an object that contains an array. The format property is set to render.DataSource.OBJECT, which indicates that the data source is an object.
If you need to pass an array, you can wrap it in an object:
javascript
var array = [...];
var obj = { arr: array };
renderer.addCustomDataSource(... obj ...);
In this example, the array is wrapped in an object and then passed to the addCustomDataSource method.
If you are trying to pass a string, you should convert it to an object first. For example, if you have a JSON string, you can use JSON.parse to convert it to an object:
javascript
var jsonString = '{"key":"value"}';
var obj = JSON.parse(jsonString);
renderer.addCustomDataSource(... obj ...);
In this example, the JSON string is converted to an object and then passed to the addCustomDataSource method.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/13/2024, 6:42 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826635301
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818248
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811972618
Celigo AI
11/13/2024, 6:42 PM