Gravity Forms: How to add PHP function to confirmation conditional shortcode?

Instead of use shortcode in your confirmation, you can use the filter hook “gform_confirmation” for manage your confirmation. After, you’ll be able to use your shortcode [useful-tools] with do_shortcode() with your confirmation.

Sorry if I misunderstood your problem!