![]() |
VOOZH | about |
Through standards-based interfaces like OData and Swagger, the CData API Server provides a native experience in Logic Apps and Power Automate with NetSuite. OData enables real-time connectivity to data; Swagger enables scaffolding, or code generation, of wizards in Logic Apps and Power Automate, as well as scaffolding Power Apps. This article shows how to add NetSuite to an IFTTT (if-this-then-that) workflow in a Logic App.
CData provides the easiest way to access and integrate live data from Oracle NetSuite. Customers use CData connectivity to:
Customers use CData solutions to access live NetSuite data from their preferred analytics tools, Power BI and Excel. They also use CData's solutions to integrate their NetSuite data into comprehensive databases and data warehouse using CData Sync directly or leveraging CData's compatibility with other applications like Azure Data Factory. CData also helps Oracle NetSuite customers easily write apps that can pull data from and push data to NetSuite, allowing organizations to integrate data from other sources with NetSuite.
For more information about our Oracle NetSuite solutions, read our blog: Drivers in Focus Part 2: Replicating and Consolidating ... NetSuite Accounting Data.
If you have not already done so, download the CData API Server. Once you have installed the API Server, follow the steps below to begin producing secure NetSuite OData services:
To work with NetSuite data in a Logic App, we start by creating and configuring a NetSuite connection. Follow the steps below to configure the API Server to connect to NetSuite data:
The User and Password properties, under the Authentication section, must be set to valid NetSuite user credentials. In addition, the AccountId must be set to the ID of a company account that can be used by the specified User. The RoleId can be optionally specified to log in the user with limited permissions.
See the "Getting Started" chapter of the help documentation for more information on connecting to NetSuite.
π Connecting to a datasource (SQLite is shown)Next, create a user to access your NetSuite data through the API Server. You can add and configure users on the Users page. Follow the steps below to configure and create a user:
Having created a user, you are ready to create API endpoints for the NetSuite tables:
Having configured a connection to NetSuite data, created a user, and added resources to the API Server, you now have an easily accessible REST API based on the OData protocol for those resources. From the API page in API Server, you can view and copy the API Endpoints for the API:
π API EndpointsYou can use the API Server in a Logic App to create process flows around NetSuite data. The HTTP + Swagger action provides a wizard to define the operations you want to execute to NetSuite. The following steps below show how to retrieve NetSuite data in a Logic App.
If your table has a column containing the creation date of a record, you can follow the steps below to write a function to check the column values for any new records. Otherwise, skip to the Create a Logic App section to send out emails to entities that match a filter.
To find new NetSuite entities since a certain time, you can write a function that retrieves a datetime value for the start of the interval:
module.exports = function (context, data) {
var d = new Date();
d.setHours(d.getHours()-1);
// Response of the function to be used later.
context.res = {
body: {
start: d
}
};
context.done();
};
Follow the steps below to create a trigger that searches NetSuite for results that match a filter. If you created the function above, you can search for objects that were created after the start of the interval returned.
http://MySite:MyPort/api.rsc/@MyAuthtoken/$oas
Use the descriptions for each property to specify additional parameters such as the columns to retrieve, filters, etc. Below is an example filter:
Class_Name eq 'Furniture : Office'
The API Server returns the descriptions and other documentation in the swagger document. You can find more information on using the OData API and supported OData in the API Server help documentation.
To use the datetime value returned from the getInterval function, use the "ge" operator with a datetime column in the SalesOrder table and select the Body parameter in the dialog. Note that quotes must be used to surround the datetime value.
π An OData filter on the results of an Azure Function App, getToday. (Salesforce is shown.)Switch to Code View and modify the $filter expression to extract the property containing the start of the interval. Use the syntax '@{body('MyFunc')['MyProp']'.
"getAllAccount": {
"inputs": {
"method": "get",
"queries": {
"$filter": "CreatedDate ge '@{body('getInterval')['start']}'"
},
"uri": "https://MySite:MyPort/api.rsc/@MyAuthtoken/SalesOrder"
}
You can now access NetSuite as data sources and destinations in your workflows.
Follow the steps below to email a report with any new SalesOrder entities.
Click Save and then click Run to send email notifications on any NetSuite records created in the last hour.
π Dynamic columns added to template the body of an email. (Salesforce is shown.)Learn more or sign up for a free trial:
CData API Server