# Is there a more elegant way to use an input field that only needs part of the selection to be returned?

**URL:** <https://community.textexpander.com/t/is-there-a-more-elegant-way-to-use-an-input-field-that-only-needs-part-of-the-selection-to-be-returned/173>\
**Category:** Have a question?\
**Created:** [April 28, 2025, 12:01am UTC](https://community.textexpander.com/t/is-there-a-more-elegant-way-to-use-an-input-field-that-only-needs-part-of-the-selection-to-be-returned/173 "2025-04-28T00:01:12Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![HaniSarji](https://sea3.discourse-cdn.com/textexpander/user_avatar/community.textexpander.com/hanisarji/32/225_2.png) [@HaniSarji](https://community.textexpander.com/u/HaniSarji)\
**Post date:** [April 29, 2025, 1:25am UTC](https://community.textexpander.com/t/is-there-a-more-elegant-way-to-use-an-input-field-that-only-needs-part-of-the-selection-to-be-returned/173/3 "2025-04-29T01:25:42Z")

</div>

In the JavaScript snippet below, you need to modify the key-value pairs in the code and the Popup Menu, but the result is elegant:

 ![IMG_1950](https://us1.discourse-cdn.com/textexpander/original/1X/88479ba6e64d95dd45fc4d6ece0008a32761bc79.jpeg)  
 ![IMG_1951](https://us1.discourse-cdn.com/textexpander/original/1X/64ec3b201d268d8ca701ebc37fd5083490e30106.jpeg)  
 ![IMG_1948](https://us1.discourse-cdn.com/textexpander/original/1X/c653c416b809bc3874e336efdf032b8225443d59.jpeg)  
 ![IMG_1949](https://us1.discourse-cdn.com/textexpander/original/1X/11acc63d4665472608e5d983fc3c4e5ee04692ec.jpeg)

In iOS, you would add this code to a JavaScript snippet:

```JavaScript
// Define the bank accounts directly
let accountNumber = {
  "Checking Account": "12345",
  "Savings Account": "67890",
  "Investment Account": "11223"
};

let account = "%fillpopup:name=Select the account:default=Checking Account:Savings Account:Investment Account%";

accountNumber[account];

%filltop%

```

---

_[View the full topic](https://community.textexpander.com/t/is-there-a-more-elegant-way-to-use-an-input-field-that-only-needs-part-of-the-selection-to-be-returned/173)._
