Rather than dropping the shortcode into the content the way you normally would, you'd instead need to add it via code with an echo.
So instead of adding [survey_records id=number qid="3" aid="selected" data="answer" uid="68" session="last"] to the content/block editor, you'd want this instead:
<?php
echo do_shortcode( '[survey_records id="' . $variable . '" qid="3" aid="selected" data="answer" uid="68" session="last"]' );
?>
Now, how you get that into the content, that depends on a lot of different factors. You can use a plugin that lets you add PHP to your content, or write a meta box for posts/pages that allows you to add variables where, if they are present, will execute this sort of function... ...you can hard code it into a specific template and then add some other method of attaching the variable, etc. Lots of ways to do it.