Hi,
I am trying to get the file content from the file type column in dataverse to my Power pages portal.
I have followed the documentation -
1. Created Webapi site setting to enable it (Webapi/sm_candidate/enabled)
2. Created a site setting for fields (Webapi/sm_candidate/fields with value sm_name,sm_domicile)
3. Using the below code to fetch the data -
webapi.safeAjax({
type: "GET",
url: "/_api/sm_candidates("+ id +")/sm_domicile",
contentType: "application/json",
success: function (data, textStatus, xhr) {
var fileContent = data["value"]; // Base 64
var fileName = "file.bin"; // default name
},
error: function (xhr, textStatus, errorThrown) {
console.log(xhr);
}
});
But it is giving me error like -
{
"error": {
"code": "90040101",
"message": "Attribute * in table sm_candidate is not enabled for Web Api."
}
}
When I cbange the value of Webapi/sm_candidate/fields site setting to '*'. It works.
Not sure what I am doing wrong here.