Table records in a select option

Hello.
I have a question, how can I take the objects from a table record list for the single or multi select?
Does anyone have any ideas?

2 Likes

Hello @katha, and welcome to Tulip Community!!

There are several ways to enter objects from a Table Record into a single or multiselect. This being said, I think the simpler way is by embedding an interactive Table within your app. Once you do that, you can trigger Actions on Row Selection.

Something along the lines of (this is only showing the message, but you can add any Action you need on the Row Selected trigger):

  1. Interactive Table
  2. Trigger on Row Selected
  3. Result

Would this help you achieve what you’re trying to build??

If you’re looking for more examples, @oviland had a similar question yesterday: https://community.tulip.co/t/how-can-i-load-unique-field-table-values-into-dropdown-list/835 :link:.

It didn’t help me. Above are some screenshots what I wanted to create. Is there no easy way to put the ID’s from a table into a dropdown list?

@katha, there is a simple way of doing this, although it does involve a couple of steps:

  1. Create a connector to your Table (more info.: https://support.tulip.co/en/articles/3983173-how-to-use-the-table-api :link:)


  2. Write a function to get all records from your Table

  3. In your App, run the connector function and store the returned values to a Variable

  4. MAP_TO_TEXT() the returned values and select the key you’d like to extract. In this case, I’m selecting the ‘id’ field:

  5. Select the newly created array as the Options input for the Single Select

  6. Result:

let me know if this makes sense, and if you’d like we can review it during Office Hours on Thursday at 11AM EST??

gio

Use Table API from a connector function is a best practice? (Security)

hello @youri.regnaud, what are you referring to with regards to security??

while this is not the best practice in the long term, it is a reliable solution with the way the product currently stands. but, so long as User roles are properly setup within your account with regards to who has access to create/read/update/delete Connectors, there shouldn’t be an issue with using the above suggested solution.

gio

@gio . I believe this observation underlignes a possible new conception about table record. Moreover, in case of batch record functionnality , the loading table records should be reusable in different standards widgets such as single and multiple select. Currently, table record is a seperate field/format of value, while his conception is currently the same as an"object".

@gio
To create API: I can’t find bots and in my version don’t exist settings under my profile image

hello @katha, only Account Owners have access to the Settings menu. do you know which User Role you have??

if you’re not the Account Owner, could you ask the Account Owner within your Tulip Account to create the API for you?? if you don’t know who that is, you can follow up via direct message and we can discuss there!!

gio

@gio, my role is Administrator. So now I am trying to create a connector with SQL language, but you know what I should insert in Server* in the edit of the connector field? And I can switch a connector also only online if I am a owner ?

@mathieu.rey OK, thanks for the clarification!! we are indeed building better Tables interaction from triggers, and I agree that having batch update is important. we’ll keep you posted with updates!!

but in the interim, the above solution allows for arrays being returned from a Connector function to be used in a Single Select widget (where the data doesn’t necessarily need to come from a Tulip Table). let me know if that’s helpful!!

@katha just to clarify, the above suggested solution makes use of HTTP connectors, not SQL.

but to answer your questions:

  • the Server is the address where the Database can be accessed. if you’d like to use the Table API (that is using HTTP, not SQL), you can use: {yourAccount}.tulip.co. however, prior to doing this the a Table API does need to be enabled.
  • Account Owners, Administrators and Connector Supervisors can make set up Connectors within your account. more info.: https://support.tulip.co/en/articles/2259988-managing-user-roles-on-the-people-page :link:.

hope this helps!!

Hello Gio,
I followed this post and your tutorial with a lot of interest and I’ve tried to make an example on my own.
However I’m stuck at step 2 where I need to create the function. (I send screenshot below)
Could you share with us the request you use for your example?
Thanks a lot by advance, Patxi.

hello @pte, great to hear it’s useful for you!!

here is the screenshot (note the outputs needs to be an array of objects where the extractor is simply ., and the Response Body should be a JSON):

furthermore, I am setting the Authentication on the Connection Details:

and the Authentication is automatically pulled into the function:

could you attempt to see if that works for you??

finally, would you like to join to discuss this during Office Hours :link: this Friday?? let me know and I can add you to the invite!!

gio

Thanks again for your prompt answer Gio, very appreciated. I tried again but I’m stuck with the same message when I’m running the test : “Function test failed : Unexpected token F in JSON at position 0”

  • As I’m working in Bangkok, I will try to go to your Office Hours (but not that one on Friday at midnight for me haha)

1 Like

hello @pte, enabling TLS to Yes should resolve the error message your seeing:

can you confirm this is indeed the case??

gio

1 Like

Hello Gio, it’s working ! I enabled TLS (and I also set my object Record to “list of value” because I didn’t do it previously)
All good, I will use it many time to select work order or batch number :slight_smile:
Thanks again !

2 Likes

hello @gio,

It still doesn’t work in my App. Maybe you have any idea?


Hi Katha,
I spent some time on this topic and from your screenshot I’m pretty sure that you didn’t select “list of value” for the object record (second screenshot). Hope it will help :slight_smile:

1 Like

hello @pte,
thank you for your response. After I read your answers here I tried with a list of value, but my connector still doesn’t work. I can’t insert in the Expression the name of the object (in this example here @variable.Records.records), so maybe there is my problem.