with Odoo and Zoho Forms?
Emit new event when a specific form receive a new response.
Fetches the meta information of all the forms present in a Zoho Creator application. See the documentation
import xmlrpc from 'xmlrpc';
export default defineComponent({
props: {
odoo: {
type: "app",
app: "odoo",
}
},
async run({ steps, $ }) {
const url = this.odoo.$auth.server_url;
const db = this.odoo.$auth.db;
const username = this.odoo.$auth.username;
const password = this.odoo.$auth.password;
// Create clients for common and object endpoints
const common = xmlrpc.createSecureClient(`${url}/xmlrpc/2/common`);
const models = xmlrpc.createSecureClient(`${url}/xmlrpc/2/object`);
// Using async/await with promises
async function getFields() {
try {
// Authenticate and get uid
const uid = await new Promise((resolve, reject) => {
common.methodCall('authenticate', [db, username, password, {}], (error, value) => {
if (error) reject(error);
resolve(value);
});
});
// Get fields
const results = await new Promise((resolve, reject) => {
models.methodCall('execute_kw', [
db,
uid,
password,
'res.partner',
'fields_get',
[],
{ 'attributes': ['string', 'help', 'type'] }
], (error, value) => {
if (error) reject(error);
resolve(value);
});
});
return results;
} catch (error) {
throw new Error(error);
}
}
return await getFields();
},
})
Zoho Forms API allows you to automate interactions with your forms and the data you collect. Leveraging Pipedream, you can harness this API to trigger workflows upon new form submissions, manipulate form entries, and sync data with other services. Pipedream’s serverless platform simplifies integrating Zoho Forms with hundreds of other apps, empowering you to create custom, scalable workflows without hosting or managing servers.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
zoho_forms: {
type: "app",
app: "zoho_forms",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://forms.zoho.com/api/zforms?zf_service=Pipedream`,
headers: {
"Authorization": `Zoho-oauthtoken ${this.zoho_forms.$auth.oauth_access_token}`,
},
})
},
})