Do Transactions Need Operations rather than Data API

My app is often making 20+ api calls with a single click. After doing some research, it seems I should convert almost all of my logic and API services to Transactions, to reduce the number of API calls.

Can I just move all of my Data API blocks like Load Table Objects and Upsert into a Transaction to instantly get it to count as one API call, or would I need to switch out all of my Data API blocks to equivalent Operations blocks from the Transactions menu, like the Find operation, instead of Load Table Objects?

The primary purpose of transactions is not to “group operations” to get fewer API calls. Transactions are all about maintaining a consistent state of the database when you perform multiple related changes and some of them fail.

If your app’s logic does indeed perform related changes and data retrievals, then yes, you can group them into a transaction. However, keep in mind that there is a limit for the number of operations in a transaction. The limit can be lifted with a purchase of an extension from the Marketplace.

I was following your advice here about using Transactions to reduce API calls to improve performance and reduce costs. I also watched your video about how Transactions can improve data integrity with an all or nothing approach to completing the operations.

To the question at-hand though, do I need to change all of my Data API blocks to Operations inside a Transaction if I want it to work as intended and count as one API call? Or is merely moving a Data API into a Transaction sufficient? I’m not sure what the difference is between a Data API block and an Operation that does the same thing.

If you have an API call that retrieves data, and move it into a transaction that has one operation. Executing that transaction will still count as one API call - i.e. the call to invoke the transaction.

A Data API block performs a function. The same function can be performed as an operation in a transaction.