I am trying to create a module with the ff details :
List : Users
Line item : Roles ( format is list - roles)
Is there a way to create a formula for the Line item so it will pick up the role in the User setting?
Unfortunately it's not possible to get user roles from User settings with a formula.
Unfortunately, there is currently no way to do that automatically (there is a proposal to implement it: https://community.anaplan.com/t5/Idea-Exchange/Create-a-Formula-to-Reference-a-User-s-Model-Role/idi-p/80678). As a workaround you can export Users settings table and reimport it into some module, create list of roles based on that etc. However, then you need to be careful to update it any time users' access changes - that's why probably it's a task for data integration/automation.