Is it possible to have a customer add their own choices?

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.

1 Like

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.

I think the above would work quite well…

3 Likes

Sorry but what is the RowIndex method? Getting stuck at that part

The second use case described below:

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.

I feel like my brain isn’t quite understanding this step, I did the below as per your video (added the extra rows myself)

This is in my customers table:
Screenshot 2024-01-30 185622

This is my query for loggedinuser plus single value of the multiplefiles column(tried the array column too just in case)
Screenshot 2024-01-30 185442
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:


But pretty sure thats wrong since its not adding new rows. Idk I feel confused with the use case I suppose

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.

Ok so I have done this:


But it is only showing 2 rows, should it be adding a 3rd row automatically as theres 3 values or must I manually add more rows?

No, you need to add as many rows as you are likely to need.

4 Likes

Ok thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.