The relationship field returns an array of post objects. Each post object contains the ID of the related post. The ACF field functions accept a second parameter, which is the post ID you want to retrieve data from, if it is not the current post.
if( $related_pages = get_field( 'data' ) ):
foreach( $related_pages as $page ):
the_field( 'special_offer', $page->ID );
endforeach;
endif;
All of this is from the ACF documentation, which is pretty thorough with many examples.
EDIT
If you want to use template tags that require the global $post
var, you have to use setup_postdata() to populate it with the post’s data. Note that get_the_excerpt
does not accept a post ID like get_the_title
does.
if( $related_pages = get_field( 'data' ) ):
foreach( $related_pages as $post ): // you must use $post for this to work
setup_postdata( $post );
the_title();
the_excerpt();
endforeach;
wp_reset_postdata(); // restore global $post for outer loop
endif;