Get Value of Select Option in Repeating Row

I have a data set (assets) that I’m pulling from Xano, which I am listing using repeated rows in a table element, not using data grid as it’s too rigid to use.

Each row has 3 select options(project, vendor, topic) that are options from other Xano collections each with their own ID values. These are ID values are table relationships in the Xano Assets table.

On change of each of these selects, I want to update the Xano backend for that asset record. However, I don’t see any variable available where the input value is stored nor do I see the value in the “event” part of the workflow --it’s empty.

How can I access this value information and process it into the backend?

You should use which can be found here.

You will have all data related to current row there.

Unfortunately, for some reason, doesn’t appear to be of use. That item data is not reflective of the selection value, it’s reflective of the collection value - 0. Where it should be, after selection, any positive integer.

As you can see in the attached screenshot, the project_id value is 0, where from my selection it should be 1.

Is something net set correctly?

Try combining two events, on-click on the item list and on–change on the select elements. With the on-click on the item list you should get the row clicked id easily, and save it into a variable. With the on–change you just control whether to make the request to Xano or not. I also recommend you to make the request to Xano in a separate (global) workflow and execute it anytime you need to, especially because you have several select elements in the row that can trigger on-change events. By doing so, you will have only one place to maintain the request to the backend.

Depending on the use case, another option could be to let the user make as many edits on the item list on the front–end as he likes, and when he finishes editing, then and only then you make the request to Xano to change all the rows edited in a single database transaction.

it’s empty until you run the workflow in preview. the value will be there

Awesome. Yes, this was it. Took me a minute to see that you were using dot notation in there. But, that was it. Thanks!

I’m still stuck on one part of it however - I have a checkbox. And applying the same variable/workflow to the checkbox doesn’t result in a boolean value on the “event”, just x/y coordinates.

what event are you using? a click event maybe? for input values you want to use the valie change event.

Yes, it’s ‘on click’ as it’s a checkbox. I do not have the ‘on change’ option in the workflow.

I’m trying to use a variation of your checkbox selection post. I’m binding the initial value of the checkbox to the variable object that will be created.

Screenshot 2024-04-19 at 7.48.57 PM

However, on initial load the value doesn’t exist. So, the initial value formula just results in undefined.

Therefore, on initial selection, the workflow which has that true/false split, doesn’t trigger properly.

I kept working on this and I got the checkbox behavior to work out. I bound the state of the checkbox to my array value instead of the initial value. That clears up the logic for the display and value.

I’ve now come across two UX issues, one of which I’ve hacked a fix.

UX Issue 1
I have 3 select columns: Project, Vendor, Topic. The options for topic are dependent on which project is selected. Changing the value for Project changes the available options for Topic. The UX issue is that if the end-user has already made selections for project and topic and then decides to change the project - the topic value and display needs to be cleared to signify the user needs to select a new topic.

Normally, I’d do this with a workflow that resets the variables value, however that’s not an option here since it’s not exposed. I wound up assigning and HTML ID to the select field, toggling the “clear” option on, and writing a custom JS to mimic a button press on the clear button to clear the visual display of the clear button.

It works, but it’s very hacky. Also, you have to have the ‘clear’ button visible for it to work.

Is there another way to accomplish this?

UX Issue 2

In a similar vein, stemming from the fact that the value is not exposed, the end-user should be able the select (check) any of the available rows and then change the value of 1 of the select fields and have that value applied to all the checked rows.

This isn’t really an issue to set the array value that I control, however, I don’t currently see a way to change what the select option displays. Therefore the end-user would never know that the value applied to the selection.