Hello there!
I’m looking to assign a collection field of type “Reference” to a dropdown.
The ID of the reference field is 46b40fc8-f433-45ce-aa0a-6c85b7c22bc2
After getting the item, I try to assign the reference value to a dropdown.
Item from collection
{
"description": "This is a description.",
"_id": "4d37819d-c259-4ed6-a5bc-d12d7654e9b2",
"_owner": "bf9f633d-e83d-47ba-b206-08090cfc681e",
"_createdDate": "Fri Nov 24 2023 12:33:51 GMT-0500 (Eastern Standard Time)",
"_updatedDate": "Tue Dec 19 2023 17:00:14 GMT-0500 (Eastern Standard Time)",
"sub-category": "3233922d-c754-46d5-863b-9035403333cd",
}
If I do it like that, my item is getting selected correctly:
$w(‘#sub-category’).value = “3233922d-c754-46d5-863b-9035403333cd” // working
If I assign the dropdown directly from the collection, my item is not selected.
$w(‘#sub-category’).value = String(item.sub-category); // Not working
And Yes, my dropdown is getting populated with all the sub-categories.
What am I doing wrong?
Thanks!