I have been working on a project to clone an existing user to create a new user. I need to be able to pull all the information from the existing user's record, including permission sets. I have a basic flow created that functions like this:
- Screen prompts user to enter the email address of the user to clone
- Record Lookup element finds the user record based on matching email address and pulls configurations (role/profile, is Marketing User checked?, etc.)
- Another record lookup takes the userid and looks for permission sets
- A screen prompts collection of info for new user (Name, email, etc.)
- a record lookup gets managerid based on manager's email address entered in step 4
- Record Create element to create the new user
- Another record create element to add permission sets found in step 3
I am extremely inexperienced with flows and I am trying to learn as I go, but I am pretty sure that I am NOT going about this the right way. The flow is working, in terms of finding the user to mirror, and is pulling some info like role/profile and creates a new user, but it is not pulling all of the information needed. The most pressing questions I have now are:
What is the most efficient/proper way to accomplish this?
How do I pull all permissionSetIds assigned to the user being mirrored so that I can assign them to the new user?
How do I configure variables for checkbox fields to carry over? (Marketing User, Service Cloud User, etc.)? I have variables created but I've noticed when testing the boxes aren't being checked on the new records.