How to retrieve Select field's label with different UI component

Hi,

On Page enter I retrieve list of objects and map it to value/label for later use in Select field as options:

It then is bound for select field, and when any value is selected it is also put in Page Data:
image

When I select particular value, I need to perform some modification on UI based on what content is within label of selected value (maybe this is wrong implementation idea)

From console I see my mapped list with values and labels, also I see that selected item, returns objectId (since it’s mapped to value) but when trying to get label, it is shown as undefined.:

Is there a way to get the content of label that was mapped in first screenshot, through other UI elements? Ultimate goal is to modify another input field label, based on what value is selected, (without additionally requesting db for the object).

Best Regards,
Uldis

Hi @Uldis_Borkus,

If I understand correctly, you can try to get the data from Page Data - storesCollection, and then search for the selectedStore field in the storesCollection list.
If this solution does not work, please provide your AppId for a more detailed understanding of the current situation.

Regards,
Sergey

I see, any directions regarding the logic? Went over list code less blocks, started trial and error approach with


but I guess it has to do something with the selectedStore item I try to find this way, as it returns 0 every time I select any of the 10 stores from storesCollection.

Please try this option.

Regards,
Sergey

@Sergey_Androsov This is excellent. Thank you for help!

1 Like