interactions with referenced fields
Options
![mohan ramanujam](https://us.v-cdn.net/6037124/user_avatars/4156573.jpg)
mohan ramanujam
Member ✭
My primary table A has a field references a attribute table B which has list of string which reference different attributes that the field in table A can take on e.g. "eat", "walk", "sleep", i.e. +. I am not using enum types here. In an API to table A, can I create/update this field using text instead of the number. In the UX I will have a string list and I would pass that string via API.
Comments
-
Yes, you can. First do a Get Record to table B that looks up the record based on the field that is a string, this gives you access to that record, which you can take the return variable and use dot notation to update table A with the appropriate ID from table B
-
so a two step process or is there a way to couple this so from api perspective it is transparent. Would I stack it in the API
-
you can do all that inside the function stack of your api endpoint. No need for multipl network transactions. -
please provide a link to an example just in case i need. New to xano.
-
one of the reasons for using attribute table is to have extensibility outside of tables that use the attribute.I considered enums but felt it is harder to extend in programmatic way. ANy thoughts on enums vs the approach I am taking
-
here's an example of this on our YouTube channel:
https://youtu.be/vyyfS5uc1lE
-
thx
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback