21
Views
2
Comments
How to assign selected value back to  search dropdown
Application Type
Mobile, Reactive

I am using a search dropdown to select files from my database. Once a file is selected, I fetch and display all associated items in a table. From this table, users have the option to update item details, which redirects them to a different page.

After updating the details and returning to the original page, I want the previously selected file to remain intact along with its associated items. Currently, the selected file is lost. Although I maintain the fileId and selectedFile variables locally, I cannot invoke any server actions, data actions, or aggregates during OnPageInitialize to refresh or reassign the selected file based on the fileId.

Could you please guide me on how to ensure that, after updating item details on another page, the selected file and its associated items are preserved when returning to the original page?
Time being i have used if condition to check it the FileID is not null then only refresh the DataAction and update the file Name variable to display the earlier selected file.
However i am getting warning like data might not be available and avoid data inconsistency In OnInitialize() 


OnInitilize I am calling Data Action with selected fileId


Thanks,

Pradip Chavhan

2025-12-22 13-50-43
Sherif El-Habibi
Champion

Hello,

In other words, you want the selected file to behave like a saved draft so that when you return to the page, the same file and its associated data are restored correct?

If you want to maintain the selected file securely on the client side, I recommend using a Client Variable. 

The idea is simple: once the user selects a file from the dropdown, you store its ID in a Client Variable. When the user returns from the update screen, you read that variable to reassign the selected file and reload its items automatically. And once the final save is completed, you clear the Client Variable so the draft is effectively completed.

2025-04-17 05-42-16
Ajit Kurane

Hello Pradip,

Hope you are doing well.

In addition to above suggestion, please refer oml from the below thread for your reference.

https://www.outsystems.com/forums/discussion/87556/dropdown-search-remember-selected-value/

Thanks,

Ajit Kurane.


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