Create apps on different pages

I have a requirement where the custom app I created for the ticketing page, should give an alert/note on the Companies screen. Is it possible to run serverless apps on Company screening?

1 Like

Hi @Chathuranga_Suriyaar,
Good Day!
you are able to create multiple placeholders on the single app,
in the Manifest file you can give multiple placeholders to archive this.
eg:

"product": {
    "freshdesk": {
      "location": {
        "company_background": {
          "url": "template.html"
        },
       "ticket_sidebar": {
          "url": "template_1.html",
          "icon": "logo.svg"
        }
      }
    }
  }

this will work on both placeholders.

hope it helps :slight_smile:

Thanks

1 Like

@Chathuranga_Suriyaar

Broadly I understand that your app is completely serverless.

There is no Platform runtime API from the platform’s end to directly trigger an alert or notify them. But there’s one hard way to accomplish it.

  1. Let the serverless component create a DB record.
  2. One the frontend of the app run a setInterval(..) equivalent web API to regularly make client.db.get() calls to see if there’s a new DB record available.
  3. If available, use client.interface.trigger(..) method to show a notification to the users.

Allowing apps to invoke notifications on Freshworks’ product interface directly from App backend is still a #feature-request

1 Like

If you question has nothing to do with alert or notification, and completely is scoped to placeholders then I suppose @Santhosh 's answer here is accurate.

2 Likes

Hi @Saif -

First of all, thank you so much for getting back to me.
As you mentioned on the note, yes the program I have created is a serverless app.
My idea behind the project is to have the ability to add multiple companies to a single ticket, and when you go to those company screens, the ticket ID should be automatically mentioned on the screen.

I am gonna try your method. I am fairly new to Freshdesk development so do let me know if you have any thoughts on this. Thank you again.

1 Like

Hi @Santhosh -

Thank you so much. I was not aware that we could do this way.
However I did the changes to my Manifest file to something like this.

{
  "platform-version": "2.0",
  "product": {
"freshdesk": {
  "location": {
    "company_background": {
      "url": "templates.html"
    },
    "ticket_sidebar": {
      "url": "index.html",
      "icon": "styles/images/icon.svg"
    }
  }
}

I created the template.html (A simple Hello world), but when I went to the Company background and tried to run the URL with ‘?dev=true’, nothing showed up.

Is there something I am missing here?

Hi @Santhosh - I realised where the issue was causing. My requirement is to create an app on the sidebar of the Company as below.

Do you think this is possible to achieve?

Hey @Chathuranga_Suriyaar ,
From the placeholder documentation. Unfortunately, it is not possible to run an app in the sidebar of the company page.

@Chathuranga_Suriyaar , when you use company_background as app location, the app runs in the background and it will be invisible.

1 Like

Hi @tejakummarikuntla - Thank you for getting back to me. Just want to clarify something :

Is it possible to amend changes to other fields (I.e: ‘TICKETS’ section on the Company Screen) with the company_background?

Hi @Chathuranga_Suriyaar,

It’s not possible to modify the tickets section from the app on the UI. You can find some Interface Methods that allow changing or disabling certain details on the company details page.

Tickets are automatically pulled by the Freshdesk product based on company-tickets mapping in the database. To modify them, you would have to make an API request to Update Ticket API to change the mapped company. In that case, you can only map only one company for a ticket as only one company_id can be added to the ticket property.

2 Likes

Hi @Raviraj -

Thanks for the information.
I wrote the below code on my js.

async function renderText() {
  client.interface.trigger("enable", {id: "open"})
  .then(function(data) {
    console.log(data);
  }).catch(function(error) {
    console.log(error)
  });
}

According to the Interface Methods I should be able to add any custom fields to a Company screen. However, I am getting the error saying that
{ "message": "The element ID \"open\" is invalid" }

Appreciate it if you have an idea on how to solve this. Thanks.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.