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?
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):
- Interactive Table
- Trigger on Row Selected
- 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 .
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:
-
Create a connector to your Table (more info.: https://support.tulip.co/en/articles/3983173-how-to-use-the-table-api )
-
Write a function to get all records from your Table
-
In your App, run the connector function and store the returned values to a Variable
-
MAP_TO_TEXT() the returned values and select the key youâd like to extract. In this case, Iâm selecting the âidâ field:
-
Select the newly created array as the Options input for the Single Select
-
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
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 .
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 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)
hello @pte, enabling TLS to Yes should resolve the error message your seeing:
can you confirm this is indeed the case??
gio
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
Thanks again !
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
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.