You can use the getGUID java action from the community commons
Hope this helps! :)
You might want to take some academy lessons on references because from your remarks you are trying to do stuff that Mendix already does for you. You can set references in a microflow but you need to have the objects in the microflow. So if you want to set a one on one reference between object A and B you change those objects in the microflow and point the reference to the other object. And the same can be done between parents and children to set multiple to one references etc.