When tackling the creation of a script in Microsoft, we must consider some essential points.
The number of options is much more limited in Microsoft than in Google. For example, with Microsoft scripts, it is not possible to obtain a report of the search terms of the account at any level (ad group, campaign, or account). Therefore, it is crucial to dive into the information that Microsoft offers to ensure that what we intend to do can be done.
On the page Microsoft Advertising Scripts Overview all information related to the scripts is incorporated. To see what entities can be used, you can go to the Script reference -> Single account section.
On the same page, links to code examples for working with keywords, ad groups, campaigns, etc., are included, which can be very useful.
Another fundamental difference for those of you who are users of Google scripts is that in Microsoft, Queries to obtain information are not available. All database queries must be made through Iterators.
On the other hand, Microsoft Ads scripts are oriented more than anything to reporting and the automation of very simple account management tasks. For more complex tasks or to act on more complex account parameters, it is necessary to resort to using the API.
To access Google services like Google Drive, Sheets, and Email from scripts, it is necessary to obtain credentials through the API and add specific functions in the code that facilitate access to these Google tools.
Instructions for obtaining credentials (there are several steps but the documentation is very precise and it is possible to obtain the credentials even without prior knowledge of the necessary tools):
https://learn.microsoft.com/en-us/advertising/scripts/examples/authenticating-with-google-services
(We recommend option 2 or 3 to obtain the refresh token)
Example from the official Microsoft Ads documentation that shows how to use Google services such as Google Drive, Sheets, and Email.
It is also important to keep in mind that Microsoft’s support and consultation forum is nothing like Google’s. Assistance and resources are going to be very scarce. You will have to learn step by step, relying essentially on your ability to navigate out of the inevitable dead ends that always appear.