how frequently does the letter "d" appear in:
q: how to read data from excel file and update on records present in the org 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. :)

a: there is no need to reapply permissionsetassignment because they should remain intact during sandbox refresh.
that is to say, after refresh the sandbox should still have its users,  permission sets, and permissionsetassignment. the users email will be purposefully broken, but you can edit it for the users needing access..
( that said, you can use dataloader on psa by providing permissionsetid and assigneeid)

a: you can use a class extending  sandboxpostcopy interface.  put all your setup routines in there.  have it run automatically on sandbox create/refresh.
this excel file save as csv, and load up in resources. then read it from the postcopy class and do all of your queries and updates.
can also spin up a lot of async @future methods from the postcopy class, if you start hitting governor limits.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_system_sandboxpostcopy.htm

user
The passage contains seventy "d"s.
assistant