Solved
How to add an image from a repository to a table?
Hello,everyone!
Why does it fail when I use the AddDataTableEntry service to add an image from a repository to a table?



Hello,everyone!
Why does it fail when I use the AddDataTableEntry service to add an image from a repository to a table?



// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(test_grid_image)
let image_data = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
infoTableName: "InfoTable",
dataShapeName: "test_grid_image"
});
// result: INFOTABLE dataShape: "FileSystemFileWithLinks"
var fileList = Things["SystemRepository"].GetFileListingWithLinks({
path: undefined /* STRING */,
nameMask: undefined /* STRING */
});
var fileCount = fileList.length;
var f = 0;
for( ; f < fileCount; f++){
let newEntry = {
path: undefined, // STRING [Primary Key]
size: undefined, // NUMBER
downloadLink: undefined, // HYPERLINK
lastModifiedDate: undefined, // DATETIME
name: undefined, // STRING
img: Things["SystemRepository"].LoadImage({
path: "/image.png" /* Replace with youe actual image paths*/
}) // IMAGE
};
image_data.AddRow(newEntry);
}
result = image_data;
It worked for me.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.