149
Views
4
Comments
Import data from text file and store in the DB and achieve copy paste functionality
Service Studio Version
11.54.13 (Build 62526)

Hi all,

I have successfully export data to a text file in outsystems,  Now I want to Import text file data into outsytems and achieve copy paste functionality.

Goals- 1.Import data from text file 2. Add copy paste functionality

Note- For copy paste I want to add above ss section where user can paste there data and after click on submit button it will store data into data base.

also I have attached sample table name and its attributes names in excel format where I want to store data.(I don't want to import data form excel file which I already know goal is to import from text file and copy paste)

Many Thanks in advance,



testexcel - Copy.xlsx
2023-10-21 19-42-11
Tousif Khan
Champion

Hello @subhajit ghosh 

To read the data from the Text file which is (Binary data type), Now once we import the file, Importing I suppose you are importing from the local system. It can be uploaded from the upload widget, So now we have a file now we need to read the data which is in our text file o achieve this we will use a system extension called BinaryData which has a method BinaryDataToText. After you get the text, you can split it by lines, by using the Text extension's method String_Split.

You can add the dependency of these  

Now once we have the data we can assign the data to a variable and then bind that variable to the text input on a screen.
Now if we want to achieve copy paste thing, We can do it directly with a button click or on an action 
Where we will call the entity Create action, Here you need to create a database with an attribute(name), Now make sure that the data type text has enough length to store the data.
Once the data is stored in a database. Would you like to export it via excel ?

If yes then you can directly use RecordList to excel widget available on server action, you can use that it will generate a binary file which you can pass on the client side on the client action on the download node.

Hope this helps
Best Regards
Tousif Khan



UserImage.jpg
subhajit ghosh

Thanks for your idea will get back to you if I face any problem.@tousif khan


UserImage.jpg
subhajit ghosh

Hi @Tousif Khan 

I am not able to assign values can you please check my oml and guide me now what to do,

Also check the copy paste page, I am using same server action for both pages.



UserImage.jpg
subhajit ghosh

PFA

error.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.