Prefill a dropdown in a form with external collections for doing an update

I can’t find a way to prefill a dropdown control with the unique list of items (external collection) and also have it set the default value to the currently selected item from the prior screen’s list so that a user can change the value through the use of the dropdown list and then do an update back to the external collection.

Some Details
I have a dance table as an external collection. The dance table has two of its integer columns that reference separate tables (i.e dance_style, dance_size) that have a normalized list of styles and sizes

Dance Styles

  • Jazz
  • Modern
  • Ballet

Dancy Sizes

  • Large Group
  • Line
  • Duo
  • Solo

My goal is to have an update screen for a dance. From a dance list screen, clicking on a dance item will take the user to an update screen for the selected dance. The update screen will have the fields prefilled based on the values of the selected dance. Two of the fields are dropdowns (dance style, dance size).

The dropdowns need to have the unique list from the dance_style and dance_size tables. Also, the default value for the dropdowns should be based on the integer in the dance table columns for dance_style and dance_size (the name will be shown, not the dance_style and dance_size integer key values)

Currently, this won’t work because the source you choose for a dropdown is also what you have to use to set the Default value.

If you could choose the source for a dropdown as the external collection dance_style and dance_size and then use the Current Dance data to set the Default Value I think all would be well.

Please let me know if my interpretation of the problem I am encountering is accurate. If so, and there is no semi-clean way to work around it, I will open a feature ticket for it.

Thanks!

1 Like

This isn’t exactly possible in Adalo as we can’t read those external relationships.

What you could do though is have a dropdown on the screen for the external collection that can be selected to set a record. Then you could have another component that looks like a drop down with the current record displayed using magic text. Using visibility you could have the drop down be shown if there is no current record and the other component show if there is a record. For the user to update the record they would need to click on the component and you could then have it link to a screen (which could look the same with no transition) and they could select from the drop down to set the record.

Thanks for the response! I did something similar (screenshot attached). I went with a non-editable field that has a button for changing the value and a modal screen to present the list from the api call. I also hid a field (0 height) on the originating screen so I could have the selected item’s id available to submit in the update api call.

It gets me there for now :slight_smile:

Also, Adalo wouldn’t need to know about the relationships in the external collections. I have a column in the table that has a key reference (unique id) for the Dance Style and Dance Size. What is needed is the ability to have a separate table populate the dropdown than what populates the main screen. The Adalo designer/developer can then set a default value based on the unique key field value and use the id from the selected item in the dropdown to populate the update call to the API.

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