You'll need to be more specific about how you're "grabbing" the URL.
If you populate a hidden field with the URL of the field hosting the form, then that field will be available in
- The Advanced Thank You URL choices in Form Editor
- The onSuccess Forms API event (as values.whateverFieldYoureUsing, where values is the first arg)
If the value is submitted to Marketo then it will always be available for use (synchronously) in 2. However, if you're using some other back-end process to populate the field then it certainly will not be available immediately as those updates are async.