Custom ui (custom panel )

Hi every one, i create simple app in glitch for pipedrive but i have a problem with parameter?
How can i get selectedIds ?


Hi @Narek_Antabyan
Let’s say we are rendering a Custom UI Panel, the context is passed via the query parameters of the Iframe URL.


yes, but how can i get it from glitch

const pipedrive = require("pipedrive");
const express = require("express");
// Load environment variables. Make sure you fill the .env file
const app = express();
    // console.log(app)
// Callback endpoint
let x = app.get("/callback", async function (req, res) {
  const apiClient = pipedrive.ApiClient.instance;
  let oauth2 = apiClient.authentications.oauth2;
  oauth2.clientId = process.env.CLIENT_ID;
  oauth2.clientSecret = process.env.CLIENT_SECRET;
  oauth2.redirectUri = `https://${process.env.PROJECT_DOMAIN}`;
  if (req.query.code) {
    try {
      const token = await apiClient.authorize(req.query.code);
      console.log("Successful Auth ✅");
      return res.status(200).redirect("/");
    } catch (error) {
      console.error("Wob, Wob, Wobb 🙁");
      return res.status(500).send(error);
  } else {
    return res.status(400);

app.listen(3000, function () {
  const d = process.env.PROJECT_DOMAIN;
    `🟢 App is running \nApp Panel URL: https://${d}\nCallback URL: https://${d}`

you may use:
req.query.selectedIds in Glitch

  1. Query parametersFormat: can use the req.query property to identify URL parameters. Example code:
app.get("/", (req, res) => {
   if (req.query.selectedIds) {
      // parameter exists
   } else {
      // fallback
      console.log("selectedIds not set");

i tred this way also, but i got nothing in logs

The selectedIds get passed in based on the resource being viewed at the time. There’s a good chance the panel systems strips out existing query parameters when it builds the Iframe URL. You shouldn’t really include them if you can. Just put your full url as the Iframe url
You may also have to deal with timeouts. Since your glitch app is sleeping when not in use, Pipedrive may say it takes too long and cancel the request (I’m just guessing based on how it handles JSON panels).

This topic was automatically closed after 10 days. New replies are no longer allowed.