Why user entity can't use create action to bootstrap data from excel

Why user entity can't use create action to bootstrap data from excel

  

HI,


i want to ask as the title,

i find the entity they can import the excel file using create action to bootstrap data from excel,

except for user entity. 


Because i am transferring some data from MS Access to outsystems, and i export it to the excel file.

Other entity are successfully import.


Does anyone knows how to solve it?

Thank you.

Hello.

Users can be imported, but there are some secondary tasks that can't be automated like password creation. You must define the rules.

Check this link. The same question was asked and answered.


Hello Eva


Is your problem not being able to create the bootstrap action for the User entity to begin with or are you able to create the action, but no new records are inserted when you run it?


Best regards,

Ângelo

Hello Eva,

The answer is that you can't "automatically" bootstrap users, like you do on your own entities, because the bootstrap must be done in the same module where the entity is declared, and the User entity is in a module you don't have access (is a System module).

But you can create the bootstrap manually.

Cheers.

Eduardo Jauch 

Hi Eduardo, i have the other page, i want to ask is this way kind of correct? 

Hello Eva,

The answer is that you can't "automatically" bootstrap users, like you do on your own entities, because the bootstrap must be done in the same module where the entity is declared, and the User entity is in a module you don't have access (is a System module).

But you can create the bootstrap manually.

Cheers.



Solution

Hi Eva,

If you wanna bootstrap users into the User entity, you need to do a few things.

1. Have the excel in the resources.
2. Create the structure that will receive the data from the excel (same columns, same data type, same order)
3. Create the Server Action that will do the bootstrap.
4. Add a local variable of data type User
5. Use the Excel to List statement (like you have above), to convert the excel to a list (using your previous created structure).
6. Do a ForEach in the list returned in the previous item.
7. in the ForEach cycle, check if the user already exists in database (use an Aggregate filtered by the user mail).
8. Case the user exists, you don't need to create it, go back to the ForEach
9. If the user exists, you need to set the local variable with the relevant information, including password that should be encrypted: use the EncryptPassword functions (don't remember if it is from System or Users espace).
10. Create the user with the CreateUser entity action.

Not sure if I am missing something, but I think it is basically this.

Cheers.

Solution

Eduardo Jauch 

HI Eduardo , I am sorry to have a question again.

If this time my recourse is SQL file, do i have any method to bootstrap user into the User entity? 

Or I must change it to the exce file? 

Thank you.

Hi Eva,

If you wanna bootstrap users into the User entity, you need to do a few things.

1. Have the excel in the resources.
2. Create the structure that will receive the data from the excel (same columns, same data type, same order)
3. Create the Server Action that will do the bootstrap.
4. Add a local variable of data type User
5. Use the Excel to List statement (like you have above), to convert the excel to a list (using your previous created structure).
6. Do a ForEach in the list returned in the previous item.
7. in the ForEach cycle, check if the user already exists in database (use an Aggregate filtered by the user mail).
8. Case the user exists, you don't need to create it, go back to the ForEach
9. If the user exists, you need to set the local variable with the relevant information, including password that should be encrypted: use the EncryptPassword functions (don't remember if it is from System or Users espace).
10. Create the user with the CreateUser entity action.

Not sure if I am missing something, but I think it is basically this.

Cheers.