Extract custom keys and values from object for RPC

I feel I need to custom code some IMLs to make this happen during my custom app development. Or are there any other ways to extract that information?