Hi guys. Tell me how, when I click on the button, I can import data from an excel file, I did it, but for me it only writes the first line with values to the database, how can I write the entire contents of the file?
Hi Ruslan,
please check this document and this post.
You'll find everything that you need.
Cheers
Can you share your excel file or can you verify the data in each cell which are trying to upload. data type of each column must be matching with entity column data type and also you can debug the code during the bootstrap.
check the service center logs for more ingratiation.
Regards,
Manish Jawla
Manish Jawla wrote:
Ruslan F. wrote:
HI ruslan,
you need to add the loop after excel recordlist and call create action inside the loop because you need to iterate through the list of records.
If you need more detail, you can read this document - Import and export Excel, CSV and XML files.
You can use Bootstrap option in entity to generate the logic/ action automatically. Below is the image of how you can find this option when you right click on the entity.
Once you do the bootstrap it will create a timer and a server action. You can remove the timer if you want to import this data in your application at run time. But in server action you can find the logic to import excel data.
Keep in mind that you have to remove few condition from the server action because these generated action create this condition to avoide importing of data if entity is not empty.
You can import data from Excel files to load data to your application server entities. This is useful when you are developing and testing your application. This way, you can quickly have your data up and running in the application while developing it.
If your spreadsheet has blank cells and you're getting import errors, check this Development FAQ on how to proceed.
the data
To bootstrap data from an Excel file to an existing entity:
In the Service Studio, go to the Data tab, right-click on the entity and in the Advanced menu, choose 'Create Action to Bootstrap data from an Excel...'.
Select the Excel file, check the mappings to see if they are correct and click on Proceed.
The Service Studio will automatically create:
Publish to bootstrap the data.
When you publish the module, it executes the action to bootstrap the data. If the entity already has data, the action with the bootstrap logic is not executed.
Nuno Miguel Verdasca wrote:
No, about importing data, I know, I just need to use the button in the web form to update or add data from the downloaded file to the database)))
hi,Ruslan F,have you done it?
Something like it :