Customers are currently in their own table and we have another options table where most of the choices drop down options are stored (eg. Petrol or Diesel), however it is okay if the solution doesn’t involve either/requires a new table.
The idea is that, on the Customers end, they click the choices drop down and can see different maintenance types e.g tyres and oil change. However we want to give them the ability to add their OWN maintenance type, and for it to remember that it belongs to that customer. Eg Customer A adds Car Wash, the next time they add a maintenance they’ll see three options: tyres; oil change and car wash while Customer B will still only see 2.
Never actually tried the following, but as I was reading your question the idea popped into my head:
Store each customers list of choices as an array column in the Customers table, using a multi-files column
Use a Helper Table to dynamically expand the array into a list for use in a choice component. This should be quite simple. You’d just need a query/relation in the Helper table to target the Customer table and filter by the signed in users CustomerID, use a Single Value to fetch the array of choices, then expand that using the RowIndex method.
To add an option to the array, use a Make Array column that creates a new array from the current array, plus the item to be added, then a Set Column Values action to over write the array.
And to remove an option, do the same thing except use a Remove Element column to create the new array.
You might want to start with a default array of choices, which could be stored in the User Profile row, and use this if the Customer array is empty.
For a small number of options, you could simply number the rows from 0 to N.
Then use a Single Value column that targets the array of choices, and takes the RowIndex from Start.
That should give you a list of choices, one per row.
This is my query for loggedinuser plus single value of the multiplefiles column(tried the array column too just in case)
Now, uh, how do I get it to automatically add the correct number of rows with the choice in each row? Like I’m trying it this way:
You’re almost there, you’re just using the wrong column type at the final step.
What you want is another single value that targets the previous single value, taking N from start where N is your row index. Make sure you target the column directly, and not via the table.