July 29 (Reuters) - U.S. equity funds saw a weekly inflow after four straight weeks of outflows in the week to July 28, bolstered by optimism over positive second-quarter earnings data, however, investors were still cautious ahead of the Federal Reserve meeting.

According to Refinitiv Lipper data, U.S. equity funds drew a net $630 million in inflows, the first weekly net buying since June 22.

Electric automaker Tesla and Google parent Alphabet Inc, both reported a better-than-expected quarterly result during the reported week, while Microsoft Corp raised its annual sales forecasts.

Of the 265 S&P 500 companies that have reported earnings so far, 77% beat the consensus net income estimates, Refinitiv data showed.

Investors purchased U.S. large-, and small-cap equity funds of $4.06 billion and $1.28 billion, respectively, although mid-cap funds had outflows of $206 million.

Meanwhile, growth and value oriented funds, both witnessed outflows, valued $785 million and $2.08 billion respectively.

Among sectoral funds, gold and precious metals funds obtained $226 million in inflows but remaining sectors recorded outflows, with utilities and tech each witnessing net selling of more than $500 million.

Bond funds saw money withdrawals for the third week, leading to a net outflow of $2.88 billion for the week.

Investors exited U.S. taxable bond funds worth a net $3.16 billion, but municipal bond funds obtained marginal inflows of $47 million.

U.S. short/intermediate investment-grade funds and short/intermediate government and treasury funds witnessed $3.36 billion and $1.89 billion worth of outflows, but high yield funds gained inflows of $4.7 billion after two weeks of net selling.

Meanwhile, money market funds garnered a fourth weekly inflow, amounting to $4.34 billion.

(Reporting by Gaurav Dogra and Patturaja Murugaboopathy in Bengaluru; Editing by Louise Heavens)