The easiest way is to use broken android data recovery tool, it has mehtod to detect your device. Some tools are available, such as MobiKin Doctor, EaseUS,ETC.
If this way doesn’t work for you, you should buy a USB-C OTG Hub, it will enabled you to connect the hub directly to the damaged p20 pro via its USB -C. Cable. The hub itself has an HDMI port that you can connected to your monitor and used to display your phone. Using the mouse and keyboard ,then you would able control and access the phone via the monitor and get data back.