The global economy is slowing down, and an epic run-up in the value of the U.S. dollar relative to other currencies is taking a bite out of the revenues and profits of multinational companies. Cloud software businesses, though, are displaying strength. Big businesses currently favor projects with quick returns on investment, and shifting digital operations to the cloud delivers just those sorts of rapid benefits.

To wit, Salesforce (CRM 0.42%) and ServiceNow (NOW 1.02%) both reported solid second-quarter earnings despite numerous challenges. However, one of these cloud stocks looks like the better buy right now.

Salesforce: Enduring (but slowing) growth from a cloud pioneer

Salesforce has a broad portfolio of software solutions that help its clients make the most of their customer data and transform their IT operations for the cloud. Through the first half of its fiscal 2023, revenue is up 23% year over year to $15.1 billion. Free cash flow is up 12% to $3.63 billion, giving it a margin of 24%.  

Even in a period of macroeconomic uncertainty, Salesforce's massive toolbox is still winning over lots of new users. However, the company is headed for a significant slowdown in the back half of the fiscal year. Management recently downgraded its guidance to a forecast of just 17% revenue growth. Two primary factors are to blame. First, the U.S. dollar's growing strength against foreign currencies lowers the value of international sales. And second, the growth bump that Salesforce accrued from its acquisition of digital workplace communications company Slack last summer (which is expected to contribute about $1.5 billion in sales, or just shy of 5% of Salesforce's overall revenue) is now over.

The biggest news in the quarterly update Salesforce delivered on Aug. 24, though, was the company's first-ever share repurchase program. The board of directors authorized buybacks totaling $10 billion. That amounts to about 5.8% of the company's current market cap. Shares currently trade for 31 times enterprise value to free cash flow.

ServiceNow: A top bet on operational efficiency

ServiceNow provides software development tools to build more efficient digital workflows -- for IT teams, for employees, and even for customer interactions with a business. Automating redundant processes (which saves money over time) is something businesses are willing to spend on right now. When the economy is slowing, cost-cutting initiatives tend to take the spotlight, and ServiceNow's solutions help in a big way.

ServiceNow's second-quarter financial report also shows its services are in high demand. Revenue was up 25% year over year in the first half of 2022 to $3.29 billion. Free cash flow rose a very healthy 27% to $1.05 billion (32% of revenue). 

But ServiceNow, too, expects its expansion will slow in the back half of the year. Management is now guiding for full-year subscription revenue growth of 24% and a free cash flow profit margin of 30%. Previously, it was guiding for 26% and 31% growth on those metrics, respectively.

Despite management's slight downgrade of expectations, ServiceNow is proving it's a durable cloud technology business in good times and bad. The stock currently trades at an enterprise-value-to-free-cash-flow ratio of 45.  

Which is the better buy now?

Salesforce has a long history of delivering double-digit-percentage annual revenue growth, and in the wake of its big acquisition of Slack, its profit margins are back on the rise. It also has an expansive list of services that organizations of all types need as they adapt their operations for a new digital era. Of these two companies, ServiceNow is growing faster and generating slightly higher profit margins. However, its stock price carries a higher valuation that reflects those things. 

Thus, the real differentiator right at the moment could be Salesforce's share repurchase program. The deficiencies arising from currency exchange rate headwinds and other economic factors could be mitigated by a shrinking share count, which will boost its free cash flow per share. There's a lot to like about both of these cloud computing leaders, and I think both have their places in a well-diversified portfolio. But I think Salesforce stock is the slightly better buy at this juncture given its new plan to start returning excess cash to shareholders.