we have a scenario where we are refreshing the org and have taken up the backup of users, permission set assignment, and their public group. After the refresh, the task is to upload the backup data, which is in excel format, again into the org post the refresh work. The backup excel consists of users, their basic details, and more importantly their assigned permission sets and public groups, which can be more than one entry in an excel cell for a user, separated by a comma, like in the image below.
I've created a script which has a list of User standard object and basic user details manually fed to that list, which just inserts the record of the users. Now I have to create a script or two, to update the permission set assignment and group membership of each user according to excel.
Is there any way I can do this task through apex where I can load the data from excel and loop through it picking up PSA and Groups for each user and then assign that to the respective user again?
This has to be done through apex scripting only where the scripts will be directly run so also can't make any method calls too. Can be done using brute force and manual effort but since this refresh thing happens often thus a script that extracts the details from excel and update in the org will help a lot.
Fairly new to salesforce so bear with me please. :)