I am having trouble getting the correct dropdown value to populate when trying to edit a record. I have a repeating group with an edit icon in each cell… The edit icon will kick off an api call to pull the individual record. I then have another edit group to edit that record; however, when it pulls the value all the values appear correctly in the edit group except the dropdown box. It is always blank no matter if the record pulled for edit had a value assigned or not… Not sure how to get the dropdown to show the correct choice?
Anyone? This is my last bug before pre-release…
Is this an external API call ?
Sounds like it hasn’t completed before you are showing the dropdown ?
Yes it is an external api call… but my problem is that I can’t get the dropdown to show the data correctly… for example if the api on the repeating group selects to edit a record that has value of ‘A’ for the dropdown field… I can’t get the edit dropdown to show that the ‘A’ was selected for that record… In other words if I am editing a record that has field a, field b, dropdown values in the database… The edit group is showing field a and field b fine, but the dropdown is blank and doesn’t reflect the dropdown value that is stored for that record… All the possible selections for that dropdown are there but none are chosen… Understand?
To ask the question as simply as possible: How do I get the dropdown to default at the result of the api call within my edit grouping?
Can someone just show me an example where they have a repeating group which has a dropdown value, and then show when you click on the edit for that row, it populates the dropdown correctly within an edit group? That would be marvelous and I would be willing to pay $10 by paypal for the first person to help me with the solution.
I’ve included the editor link for this page so you can see what I am trying to do… When you click on the pencil in the task repeating group, it should populate the edit section at the bottom of the page. The fields all populate correctly except the folder dropdown field. This is what I am trying to get to work…
https://bubble.io/page?type=page&name=index&id=dropdownproblem&tab=tabs-1
Hi @bkhoward2001 - if I’m following your issue, I had a similar issue with getting a default value for a dropdown that was fetching from an API call (though not in a RG). To solve it, I needed to do an API call in the “Default value” field, then do a filter on the returned values (which also included doing a Search within the Filter - see pic below and the text in red).
Not sure if this helps or not but for my app, doing this allowed me to have Default value populated with correct data. Initially i was reading data from data record but that didn’t work.
I am not sure I am following this… what would be the filter criteria in red?
In my case, I have many Users and a Custom Data Type that stores API info for each User. So while I do save the API data in the Custom Data Type (I save one piece or “line” of data from a list of data from the API call) for each respective User, the Dropdown didn’t work.
By this I mean I couldn’t show the Current User’s data from the Custom Data Type in the Dropdown.
I don’t recall the error exactly but the Default Value in the Dropdown was expecting the same Data Type as “Choices source” (which is the API call type and not “Text” like the data field is in the Custom Data Type). As such, the Dropdown wouldn’t show the database value from the Custom Date Type for that specific User.
To fix the issue, I do an API call in the Default value field. If I don’t add the :filter, I get all of the data from the API call. In the filter, I have the API URL Parameter Key equal to a Search value (what you see in red). In the Search I use other data fields from the Custom Data Type to find the Custom Data Type instance for that particular User. Then the data field from the search result should be set equal to API URL Parameter Key (similar to what you see in the Filter’s constraint line above)
In your case, it sounds like you’re getting a full dump of data from the API call. If you do an API call in the Default value field and put a criteria to constrain the value, it may solve your issue. But I’m not familiar enough with your app to know what to do a Search on (again my search is for a Custom Data Type, not User as shown in red). Based on what you have shown for Choices source and Option caption, It does appear that you want a Filter constraint that would be “Folder = Search for xxxx”.
Hopefully that helps clarify and not confuse.
This is driving me utterly batty! This should be simple… This is what I need to happen!
- you click on a task in the repeating group using the pencil icon.
- The fields from that particular record in the repeating group are brought into the edit area at the bottom of the screen.
- The dropdown at the bottom of the screen contains the correct folder from the repeating group record.
Sounds simple but driving me crazy! Anyone?
How does one test it ?
You can go into my editor with link below… You should be able to do these steps correctly:
- Click on the pencil on any record in the repeating group…
- It should then display the record in the edit area at the bottom of the screen. It should populate with that record’s Task, Due Date AND folder… The folder is not populating correctly.
Hope this is clear… Should be simple but I can’t figure out how to handle this dropdown.
Oh, forgot, it will only show the current user’s tasks… So you will have to created several folders and then create a few test tasks…
Pretty much everything @nikolai said above.
I’ve altered the example to make it work, in summary:
-
Assumes no duplicate folder names for the user.
-
Changed the dropdown type to “text”, this allowed it to use the default value (folder name).
-
Altered the dropdown’s data source, etc. to get folder name instead of folder.
-
Altered the update record to lookup the folder’s id from the chosen folder name.
-
Added a step to clear(reset) the dropdown’s parent group on pressing the pencil button, this clears any manually changed dropdown value.
-
In the filter, added a criteria to check for empty choice, as a workaround for it showing the first of all options if none is chosen.
It looks like it works beautifully, except one problem… When a new folder is added, it doesn’t immediately show up in the two dropdowns as a value…?
Then you’ll need a similar process to the graph refresh, ensure you make the API request different to bypass caching.
That was what the Bogus parameter on the TaskFolderGet api was for… I have put the current datetime extracted as unix into that parameter so it would be different each time; however, this still seems to not work? I have updated the example project.
Looks like its working now?
This topic was automatically closed after 70 days. New replies are no longer allowed.