do you get an assist if player is fouled
Only the pass directly before the score may be counted as an assist, so no more than one assist can be recorded per field goal (unlike in other sports, such as ice hockey). A pass that leads to a shooting foul and scoring by free throws does not count as an assist in the NBA, but does in FIBA play (only one assist is awarded per set of free throws in which at least one free throw is made).
Assist (basketball)