i have used a file upload widget and upload a .csv file but i'm unable to display the data in a grid.
unable to write the exact service.
Hi @sadiya
If you know the structure of the csv file before hand, you can use the CSVParser extension .
Create a service similar to
var params = {
path: fileName /* STRING */,
columnMappings: 'Name;Address;Id' /* STRING */,
hasHeader: true /* BOOLEAN */,
fileRepository: "SystemRepository" /* THINGNAME */,
fieldDelimiter: "," /* STRING */,
dataShape: "ImportUsers" /* DATASHAPENAME */
};
// result: INFOTABLE
var result = Resources["CSVParserFunctions"].ReadCSVFile(params);
The ImportUsers datashape will have the 3 fields Name;Address; Id.
Then set the FileUpload widget FileUploadComplete event to trigger the service.
Map the all Data return value of the service to the grid.
Hope this helps
Christophe
Also, you can take a look at this article https://www.ptc.com/en/support/article?n=CS255612
If you were able to resolve your issue, please post it here and mark it as the Accepted Solution for the benefit of others on the community. If you are still experiencing issues, please do let us know your questions or concerns.
Thanks,
Vibhuti
