Selected default last added value in dropdown list
Question
Application Type
Mobile
Service Studio Version
11.11.12 (Build 47321)

Hi,

I'm populating the dropdown list using a structure. I just want the last added value (id) to be selected as the default in the dropdown list when the screen is loaded.

Structure: 

Files.Id
        .Title



Thanks

Khaled

Hi Khaled,


Once the the list has been fetched you have to assign its last value to the variable you're using to hold the selected value on the dropdown.


Margarida

Thanks Margarida,

Records are being fetched once the screen is loaded into a list variable.

How can I select the latest item?

Can you share an OML or an image of your flow? You can do something like an OnAfterFetch, if you're using an aggregate or data action, and assign the last value of the list that has been fetched to the variable you're using.

Something like this:

Then, in the OnAfterFetch action and inside the branch where you want this logic,  you have to assign to the variable Configuration_MultipleAddToFile.MyFileId the last value of the list MyFiles, it will be something like the assign I showed you before:


MyFiles[MyFiles.Length-1].Id

Since I don't know the actual structure of your list this is just an example, you have to adapt it.

By doing this you are indicating that you want to assign the value held in the position MyFiles.Length-1, which will be the last position of the list since the first is considered to be 0 (that's why you're subtracting 1 to the total length of the list)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.