68
Views
6
Comments
Creation of databases from form data

I was created a form where I am taking employee details as input which includes employee id, name, type so here type should be an intern or full-time employee or it can be anything so I am taking user input for this field, next is blood group and contact. So now for each employee creation I wanted to save their data when we click on save button the table is created for each employee having table name as EmployeeType_TenantID. for eg- if an employee which is an intern having tenant id 20 should have the table name as intern_20 and if further more intern comes with the same tenant id so their record comes in that table only for them there is no need to create a new table every time it depends upon the employee type whether it is same or different. Can anyone tell me how to achieve this task. 

UserImage.jpg
Kay Lun

Hi Chetna,

Not sure if I get it correctly, IMO, creating a new table for each employee doesn't make sense.

Could you explain more what you're trying to implement with each employee ? let's say, what data do you expected will be stored for each employee, and what's the difference between type, any example for that field etc.

Cuz that will easier for us to help :)

UserImage.jpg
Chetna Upadhyay

Let suppose admin login to his account and his work is to create every employee template to do so he fill the form where he entered employee-name, blood-group, employee-type, contact number. Now when he filled all the details he clicked on create button where that details are saved by generating a new table having all the fields details and that table have the table name as EmployeeType_tenantID. So the thing is application is tenant specific. For eg there is an employee which is a full-time employee named John have tenant id as 20 where tenant name should be his company name so in that case the table name should be FullTime_20 and this table have attributes as employee name, blood-group, employee-type, contact number. Now you get it what I am saying??

UserImage.jpg
Kay Lun

Hi Chetna,

Try to read through this article and see if this could give you a better idea on how to create an application for multi-tenant, in OS, they have this support, and the table data is isolated per tenant.

Hope this help :)

UserImage.jpg
Chetna Upadhyay

I already gone through this article and by this I make my application as multi-tenant as well but what I was trying to say is different. Can you tell whether it can be implemented or not??

UserImage.jpg
Kay Lun

Correct me if I am wrong, so you're looking for the table naming based on the tenant, am I right? As far as I know, the naming conversion of multi-tenant is done by OS automatically, they use TenantId to determine which tenant of the data belong to. So, sorry, I don't think that's possible. :(

UserImage.jpg
Greg Adams

That is a fascinating question which I don't understand.

From what I have read Outsystems doesn't allow apps to create tables at run time. 


I don't understand why you want to create a table based on & named by the following: 

EmployeeType_TenantID

Employee type sounds more like an attribute in a table of employees, rather than a table of its own, to me.

I don't understand why, if you want admin to be able to create new tables, admin wouldn't use service studio.

I have to assume I have not understood what you want to do.

"admin login to his account and his work is to create every(?) employee template(?) to do so he fill the form(?) where he entered employee-name, blood-group, employee-type, contact number. 

Now when he filled all the details he clicked on create button where that details are saved by generating a new table(?) having all the fields details and that table have the table name as EmployeeType_tenantID. "

You want admin to be able to create templates? Are you sure of that word?  I think this sentence suffers from a language problem.

If you really want to write an app to design templates and to create new tables in the database, I don't think that is permitted in Outsystems.

Is it possible you mean something much simpler, that admin is entering details of a new employee in one particular tenant and those details are to be written into a table where, later it can be searched by EmployeeType & tenant id?


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