How to edit UPROPERTIES programatically without knowing the name of the property.

You can get all the properties of a class like this:

for (TFieldIterator PropIt(Class); PropIt; ++PropIt)
{
FProperty* Property = *PropIt;

}

To get/set the value I used this:

TSoftObjectPtr* ValuePtr = nullptr;
ValuePtr = Property->ContainerPtrToValuePtr<TSoftObjectPtr>(PropertyOuter);

*If you want to change the default values ​​for a class, then the outer of property will be CDO (UClass::GetDefaultObject())

In this case, you need to specify a specific type of property.
But there is also Set/GetValue_InContainer but I haven’t used it.