Freshdesk End user apps with multiple products - How to get the associated product_id

Hey .devs

In order to leverage the possibilities of end user apps, we are currently switching from Mint to Marina theme and experimenting with end user apps.

Our specific usecase is to access our e-com shops data via api, where we need to get the product_id of the product, which is associated to the specific portal.

You can get the portal_id, but there is no option which would tell you the associated product.

In the portal itself there is a window.store object created, which contains both:
image

Is there any possibility to get the product_id into the end user app?

We use multiple ticket forms and I already tried to include the Product ticket field in a form. It is automatically removed, so adding product field also does not help.

Hope that there is an easy answer to my request.

Thx for your help in advance.
Best
Tom

Hey @ThomasH,

It’s not possible to find the associated product in the New Ticket Page in the Customer Portal with End-User app.

If the requirement is in the Ticket Details Page, the ticket data method has the product id in the payload.

I have submitted a feature request ticket to Freshdesk support on your behalf in this ticket (#15378185). When you get a reply from the support and product team, please respond as you find it fit.

Thank you @Raviraj

was expecting that it’s not possible atm.

My current workaround idea would be to create a ticket field, which is exposed in the portal, but hidden from customers (aswell as agents in agent portal).

This field’s content could be manipulated by portal code and requested by the end-user app.
This field could be used to communicate between portal code and end user app.

The discussed usecase would look as follows:

  • Portal code gets the product_id from the window.store object and puts it into the field used for communication
  • End user app listens to changes of that field and can therefore use the product_id

Not the best of all solutions, so I hope the feature request to be considered.
But it is at least a working one.

Best
Tom

1 Like

Can confirm, that my idea is a valid workaround.
Added a new custom ticket field cf_enduserappcomm.
On document.ready, this field is equipped with the window.store.portal object and hidden:

//hide field cf_enduserappcomm and add product_id to that field 
jQuery("#helpdesk_ticket_custom_field_cf_enduserappcomm_xxxxxx").parent().hide();
jQuery("#helpdesk_ticket_custom_field_cf_enduserappcomm_xxxxxx")[0].value = JSON.stringify(window.store.portal);
    

On end user app initialization I now use the get ticket method to receive the product_id from that new field.

I mark it as a solution for the time being, but I still see this as a plan b and would like to see the associated product_id in the get portal method.

1 Like

Thanks for sharing the workaround, @ThomasH.

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