APIs & Integrations

mathcee
Contributor

How can I control the display order of line items on a deal?

I'm having trouble keeping the line items ordered on deals.

Some of our deals have such a large number of line items that we'd like to keep them ordered in a way as to help our users. Originally I thought that If I controlled the association time I'd be able to associate them in the order desired and solve the problem this way, but even creating them in the order I want, with intervals of several second just to be sure they aren't getting associated out of turn, I still didn't get the result I want.

Anyone knows how to handle this? I can't find anything like display_order for the line items.

7 Replies 7
vishesh
Participant

How can I control the display order of line items on a deal?

I'm still waiting for a reply on this @abrow and @JOakley 

0 Upvotes
JOakley
Contributor

How can I control the display order of line items on a deal?

Also having trouble with this, did we get a solution in the end?

 

0 Upvotes
abrow
Contributor

How can I control the display order of line items on a deal?

@vishesh any luck figuring this out?

0 Upvotes
vishesh
Participant

How can I control the display order of line items on a deal?

Hi @WendyGoh and @mathcee I'm also facing a similar issue, however I am not creating line items through the API.

 

Line items can be re-ordered in the UI, by clicking and dragging a line item to a different place in the ordering. I'd like to have a way to determine what the display order is, because changing the display order does not change the order in which the results are returned from the Get associations for CRM object API.

 

Is there any way to do this?

WendyGoh
HubSpot Employee
HubSpot Employee

How can I control the display order of line items on a deal?

Hey @mathcee,

 

As mentioned on a similar dev forum thread: HubSpot Community - How to get the value of the order the line items appear on a Hubspot deal?, I did the following test:

 

On my end, I created a deal and added five products like this:

This is product one

This is product two

This is product three

This is product four

This is product five

 

Next, I used this endpoint: Get associations for CRM object and I was return the following results:

240363021 (the line item id) 

240363022 (the line item id) 

240363024 (the line item id) 

240363025 (the line item id) 

240363026  (the line item id) 

 

Plucking in those line item id into this endpoint: Get line item by ID, I was able to see that the results of the product in the line items is showing the same as what I'm seeing on the UI.

 

Are you seeing mismatch of display order between the UI and the endpoint? Could you share with me, your portal ID, an example deal and the steps you took?

0 Upvotes
mathcee
Contributor

How can I control the display order of line items on a deal?

Hi @WendyGoh 
My Portal ID: 3957645

My problem is slightly different.

I'm creating the line items via API, and it doesn't seem to matter how much I space the craetion requests, the line item ids will not be necessarily sequential.

Take the test deal 2268144437.

I created the line items, always waiting the succesful creation of one before creating the next. The Line item Ids I got came, however, in the following order:

1. 672623385
2. 672540074
3. 672539821
4. 672542963
5. 672623389
6. 672612210 
7. 672614608
8. 672551442

As you can see the IDs for the created line items are not exactly sequential, so, even though I can control the creation order I fail to control the display order. Can you help me with this?

0 Upvotes
Harald_Harstad
Participant

How can I control the display order of line items on a deal?

Hi @WendyGoh , Do you have any suggestions for this? We create deals and line items through API and need to reorganize 5 line items in thousands of deals before we continue the process. This is time-consuming. We can't figure out what defines the line item ID sequence and it seems just random.  It should be possible to make a prioritization upon a product ID. @Thomastechweb