Setting properties in a deferred custom action

I am quite new to wix and windows installers , i would appreciate some help with the below .

Platform : windows. Tools : wix , c++ for custom actions.

I have a custom action for Creation of 5 user groups during installation for each user group that i create i need to set a property if its successful, i just figured out we cannot set properties in deferred custom action , i cannot change this to immediate as i am modifying system data i understand it needs to run as deferred(correct me if i am wrong ).

How do i set property in my deffered custom action?