Update Picker List with API values


#1

Hello Everyone!

I am trying to use a ‘Show Picker Action Sheet’ to filter a dynamic list of items retrieved from our API. However, there doesn’t seem to be a way to set the selections inside of the action sheet to come from our API. Is this only allowed to be a static list?


#2

Hi Matt,

That’s a great question. Thanks for reaching out. Action Sheets are not a dynamic element inside Dropsource so they cannot incorporate dynamic data. Action Sheets choice settings are indeed limited to only static Strings. This would be a spot where a custom dynamic solution could be coded and added to your app outside of Dropsource in the source code as it’s a current limitation in the Dropsource platform. it wouldn’t be very typical situation to make an Action Sheet dynamic in its offerings since you have knowledge of the data represented on the page beforehand and can institute a set value inherently.

I wouldn’t recommend the dynamic code addition in this situation however. I would recommend thinking about the data coming in prior to the action sheet showing up and setting a design standard in the app to allow you to know what options for filtering the Action sheet should provide though.


#3

Thanks @wade. I know the regular picker sheet allows for dynamic data. Would it be better to use that option and just show or hide it based on the tap event of a button?


#4

That’s a creative solution. Yea you could totally move forward that way if it solves it for you. Great thinking!


#5

Thanks @wade. I’ll give it a shot and report back on how it turned out. Otherwise, I think having the static values in place could potentially work. I just would hate to deploy a new build of the app because we added a filter category. That seems like something that should be retrieved from our API and then displayed to the end user. Thanks again.


#6

Understood. Yea that’s a little x.x.x version release there. The PickerView should work for you here though. That was a creative solution you came up with.