Getting different user data depending on where I use variable

I’ve only seen some parts of your code, but I guess I know where the problem lies…

If this is what you’re printing in the loop:

<script type="text/javascript">
jQuery(document).ready(function($) {
    $('.callback').val('<?php echo $user->first_name; ?> <?php echo $user->last_name; ?>');
});
</script>
<?php echo do_shortcode( '[contact-form-7 id="12345"]' ); ?>

And you want to output multiple forms on the same page and every form should contain different user, then you can’t do it like that. Why? Because of this part:

$('.callback')

Your forms and JS code is printed by PHP and everything works fine. But then, the JS is run ono the client-side in client browser, when the page is loaded. So the first JS code runs, selects all elements with class “callback” and sets its value. Then the second one runs and sets value of all “callback”s again… And so on…

So how to deal with that?

One way to do this, the easiest fix, would be wrapping forms with div:

<script type="text/javascript">
jQuery(document).ready(function($) {
    $('.callback', '#user-form-<?php echo $user->ID; ?>').val('<?php echo $user->first_name; ?> <?php echo $user->last_name; ?>');
});
</script>
<div id="user-form-<?php echo $user->ID; ?>">
    <?php echo do_shortcode( '[contact-form-7 id="12345"]' ); ?>
</div>

This way you can identify every form and set the fields inside that form only.