Services Plugins FAQs

Xero - Tenant Ids

I’m having a problem with your Xero plugin. The action call “Get Tenants Id” returns a list of “Get Tenants Id (Xero)”. The problem is there’s no corresponding type. I want to pass this list into a drop down so the user can select the org they want to view. When I go to enter “Type of choices” in the dropdown, there’s no “Get Tenants Id (Xero)” option.

Thanks for your help!

Hi @tim5,

Thanks for reaching out. Are you actually looking for the tenant’s type?

Perhaps this is what you ask for:

However, could you please share screenshots and/or screencast of your app setups so we can try to replicate it on our side to see whether or not it is possible to accomplish via our plugin. :pray:

You can check our demo setups here.

Plugin docs can be found here.

Best,
Alex

Thanks for getting back to me Alex! I expected to see “Get Tenants Id (Xero)” in this list (and other lists like it). It’s difficult to get the tenant id from a dropdown of tenant names without it.

I also have another problem when fetching invoices. The “isCustomer” field seems to be blank. According to the Xero docs is should be a string - “true” or “false”. I don’t have a workaround for this at the moment so this is actually the more critical bug. Thanks for your help!

Thanks @tim5 for feedback.

Unfortunately, you are not able to see the Get Tenants Id because this one is actually an action rather than data call. Actions can be used in your workflows that trigger on an event like a button click or page load, for example.

It would be best to share screenshots and/or a screencast of your app setups so we can replicate on our side to see where the problem might be, and check whether or not it is plugin related.

Thanks!

Thanks Alexandru - hopefully this screen grab explains it better. The action “Xero - Get Tenants Id” returns an object with type “List of Get Tenant Ids (Xero)”. My problem is, I can’t assign this object to a state or set a field with it because the type “Get Tenant Ids (Xero)” doesn’t appear in any of the lists. It makes it very difficult to do anything with the data that’s returned by the “Xero - Get Tenant Id” action.

This screen grab shows the value field in red because the custom state isn’t the same type as the value. That’s because I don’t have an option to select that type for the custom state (see my last reply for screen grab of me trying).

I’ll reply again with some screen grabs of the “isCustomer” problem.

Thanks!

This screen grab above shows the action I’m using to fetch the invoices. Note the breakpoint.

The screen grabs above show the first couple of invoices with empty isSupplier and isCustomer fields. The rest of the 87 invoices returned are the same. I’m connected to the Xero demo account.

Thanks!

Hi @tim5,

Thanks for feedback.

You just need to set the Custom state as a simple text. It is not required to save as a Tenant ID object. The IDs are usually stored as text values because they may contain letters besides numbers. This solves the problem.

And if you want to store it as a List, then create your state as a List of texts. But if you simply want the ID, then hit ‘More’ and choose the Tenant ID value.

Please let us investigate this one to see whether or not it is a plugin related bug then get back with an update asap!

Best,
Alex

I really appreciate how responsive you’re being. I may have misunderstood your first answer - sorry if so.

I want to create a dropdown list so my users can select the tenant organisation. I can get a text list of tenant ids and a text list of tenant names from the response to “Xero - Get Tenants Id”. My problem is, when the user selects a tenant name, I can’t find the corresponding tenant id. Dropdowns do not return the index of the selected item.

I do have a workaround but it involves making another call to “Xero - Get Tenants Id” so I can filter the response based on the selected name. This isn’t ideal. It takes time and also if the user has two tenants with the same name I don’t know if they’ve selected the first one or the second one.

Thanks again for all your help!

Hi @tim5,

Thanks for feedback, no worries we are here to help!

The dropdown doesn’t offer the “index” of the selected item as with RepeatingGroups but you are able to target the selected option from your dropdown anyways. It can be done with the When an input’s value is changed event and just select the dropdown element. And from there on you can use the current item that was clicked and work with it’s tenant’d ID if you will, which will be the corresponding one. :pray:

This is just a bit of Bubble development tweaks, so in case you’d need some more help you can post your request here https://forum.bubble.io.

Hope it helps!

Best,
Alex

Hi Alex,

Unfortunately, it’s not as simple as that.

Step 1: Call the Get Tennants Id action
Screenshot 2021-01-28 at 17.18.17

Step 2: I want to set a field with the data that’s been returned by step 1. I can’t set the type of the field to what’s been returned by step 1 so I have to copy the list of names and the list of tenant ids instead. This is because I can’t create a field of type “List of Get Tenants Id (Xero)” which is what I would like to do. The action returns an object of this type but I don’t have access to the type.


Step 3: Set the dropdown so its “Choices source” is the “tenant names” field on the thing I created in step 2. Note that I can’t select “Get Tenants Id (Xero)” as a type of choices here either.

Step 4: How do I get the tenant id? This dropdown’s value is the tenant name (type text).

And from there on you can use the current item that was clicked and work with it’s tenant’d ID if you will, which will be the corresponding one.

I can’t do this - it’s just a text list of names.

What I need is access to the type “Get Tenant Ids (Xero)”, which is what’s returned by the “Xero - Get Tenants Id” action. This is not an option. E.g. when selecting the “Type of choices” in the dropdown, it doesn’t appear in the list. Neither can I create a thing of this type, or create a field of this type.


Please can you try it. The setup is very simple and you’ll see the problem quickly. You don’t need to preview the app to see it so you don’t need to authenticate the Xero api etc.

Thanks @tim5 for feedback.

Sorry for misleading, I’m afraid it would not be possible to accomplish it. Our plugin doesn’t provide a data call that would get the tenants, unfortunately.

Perhaps we’ll consider adding this feature as a data call in future updates, if feasible. Cannot provide an estimate on this matter but you can be sure that in case we launch a new update, I’m going to notify you asap.

The other features with data calls can be directly used in the dropdown, for example Accounts:

Just in case you require a suggestion for other information from your Xero account. You just set the data call as Type of choices, Choices source as external API and then the Option caption as the field you want to retrieve in your dropdown element.

Apologies about this situation. :pray:

Thanks Alex. Are you going to be able to work on the other bug - invoices with empty isSupplier and isCustomer fields? Like I’ve said, this is actually more critical as we don’t have a work around for it. Without these field we can’t tell if the invoice is money coming into the company or being paid out.

Thanks,
Tim

Yes @tim5,

Please let us investigate a bit deeper with our developers on this matter, then get back to you with another reply asap!

Alex

Hi @tim5,

We have investigated this issue with our developers, and unfortunately this is a problem coming from Xero service. We tested it multiple times and whether a contact is a Supplier or a Customer, the returned results are empty indeed.

I’m afraid there is little we can do because it is not at plugin level, unfortunately. The only thing we can suggest at this point is actually contacting the Xero support team - https://central.xero.com/s/contact-support and report the problem. It is based on this API call - https://developer.xero.com/documentation/api/invoices because when you simply try to retrieve the Contacts - https://developer.xero.com/documentation/api/contacts - it is returning the results.

Thank you for understanding. :pray:

Best,
Alex

Thanks Alex! Good to know there’s a workaround with the contacts endpoint anyway :slight_smile:

1 Like

Always welcome @tim5!

I hope it will be helpful. Just asking if you like our plugin so far, could you please rate it by going to Plugins tab in Bubble editor? You can find the plugin by name and give it as many stars as it deserves.

The more feedback we get, the more motivated we are to build great plugins and improve the existing products!