# Lock choice component to user

**URL:** https://community.glideapps.com/t/lock-choice-component-to-user/80285
**Category:** Ask for Help
**Created:** [February 23, 2025, 3:39pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285 "2025-02-23T15:39:41Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 23, 2025, 3:39pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/1 "2025-02-23T15:39:41Z")

</div>

This is a classic google sheets app. I want to lock the choice to the user while the user is working with the choice. Is that possible?

 ![app](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/d/4d5511f37d44454752c775576b157234309d167a.png)  
 ![choices](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/eb7a517a1b7379ef6eb46e3e4d6e45c1a58be7f9.png)

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 23, 2025, 4:18pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/2 "2025-02-23T16:18:33Z")

</div>

Use a user specific column to store the choice value.

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 23, 2025, 4:26pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/3 "2025-02-23T16:26:34Z")

</div>

I am not familiar with the use of the ‘user specific column’. Grateful if you could describe the steps!

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 23, 2025, 5:39pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/4 "2025-02-23T17:39:33Z")

</div>

To give the full picture, the CurrentID is looked up and &included& in an URL

 ![Screenshot 2025-02-23 18.35.10](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/3/a3adf11eb5d1ebfbf579c655335e1f1a202523d2.png)

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 23, 2025, 5:48pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/5 "2025-02-23T17:48:51Z")

</div>

Just add a new basic text column and check the box for ‘User Specific’. Then use that with your choice component instead of the existing column you are using now.

> **[User-specific columns | Glide Docs](https://www.glideapps.com/docs/essentials/security-and-user-data/user-specific-columns)**
>
> Allow cells to hold unique data for each user.

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 23, 2025, 6:26pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/6 "2025-02-23T18:26:00Z")

</div>

The user specific column does not show up in Google Sheets. How do I extract the currentID from the Glide table and then include it in the URL?

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 23, 2025, 7:02pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/7 "2025-02-23T19:02:22Z")

</div>

Sorry I might have been misleading you.  
EventChoice =N2&" "&O2  
CurrentID=left(R2;7)  
CurrentTävling=vlookup(S2;N1:P;2;false)  
CurrentTL=vlookup(S2;N1:P;3;false)

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 23, 2025, 7:48pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/8 "2025-02-23T19:48:19Z")

</div>

Well, user specific columns are internal to Glide, because they can store multiple values for multiple users in the same cell.

Your options are to use the a column in the user table instead because user profile columns are available everywhere in the app, or move your logic to Glide so you aren’t reliant on Google sheet formulas.

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 23, 2025, 9:57pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/9 "2025-02-23T21:57:28Z")

</div>

Thanks Jeff, I understand. As you know, I’m 83 now and it’s too hard for me to move from Sheets to Glide tables. What are the Glide equivalents to the above Google formulas and this concatunated url:  
=“[https://www.golfbox.se/livescoring/tour/?language=1053#/competition/“&$S2&”/players](https://www.golfbox.se/livescoring/tour/?language=1053#/competition/%22&$S2&%22/players)”  
My intention is to move the logic to the Glide built in Data table. Wouldn’t that be possible?  
🤓

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 23, 2025, 10:34pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/10 "2025-02-23T22:34:38Z")

</div>

> [@Ralf](#):
>
> EventChoice =N2&" "&O2

template column

> [@Ralf](#):
>
> CurrentID=left(R2;7)

text slice column

> [@Ralf](#):
>
> CurrentTävling=vlookup(S2;N1:P;2;false)

Relation/Lookup columns

> [@Ralf](#):
>
> CurrentTL=vlookup(S2;N1:P;3;false)

Relation/Lookup columns

> [@Ralf](#):
>
> url:  
> =“[https://www.golfbox.se/livescoring/tour/?language=1053#/competition/“&$S2&”/players](https://www.golfbox.se/livescoring/tour/?language=1053#/competition/%22&$S2&%22/players)”

Template column or Construct Url column

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 23, 2025, 11:05pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/11 "2025-02-23T23:05:03Z")

</div>

> [@Ralf](#):
>
> intention is to move the logic to the Glide built in Data table

Also should mention that you don’t have to switch to a Glide table if you don’t want to. Glide tables will save you a ton on updates, but that’s all up to you. All logic can still be moved to a Google sheet table with computed columns.

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [February 24, 2025, 7:17am UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/12 "2025-02-24T07:17:55Z")

</div>

The data source is an importrange from an external spreadsheet. How can I keep it live in a Glide Table?

 ![Screenshot 2025-02-24 08.11.27](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/e/5e1b356517e5a6746bc20ac9abd9978c7d82c5fd.png)

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 24, 2025, 1:14pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/13 "2025-02-24T13:14:42Z")

</div>

Same as you are doing now. The basic data comes from the google sheet, and you add the computed columns to the same google sheet table through the guide data editor. Like I said before. You don’t have to switch to a Glide table. Just use your same Google sheet table, but move the computed logic to glide using computed columns instead of sheet formulas.

My main app is mostly google sheet tables, but the calculations happen with computed columns in those same tables. It’s a heck of a lot faster than using google sheet formulas and waiting for data to sync back and forth.

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [March 2, 2025, 11:16pm UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/14 "2025-03-02T23:16:59Z")

</div>

Works great, avoiding sheet syncing increases performance dramatically! How do I “Slice from right”? Is it possible to use REGEXTRACT?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 3, 2025, 12:00am UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/15 "2025-03-03T00:00:52Z")

</div>

You could potentially still use text slice. Is your value a consistent length? Would you always get the same number of characters from the right? Do you have any examples of what you have and what you want for a result?

---

<div class="post-metadata">

### Author: ![Ralf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ralf/32/492_2.png) [@Ralf](https://community.glideapps.com/u/Ralf)
#### Post date: [March 3, 2025, 7:23am UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/16 "2025-03-03T07:23:03Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/9/c970b84966934d871a5f1286ba6af7ec73e4ca53.png)  
I would like to extract:  
4801699 consistent length  
El Higueral varying length  
2025-03-09 sön 11:00 consistent length

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [March 4, 2025, 12:48am UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/17 "2025-03-04T00:48:34Z")

</div>

You can use a JavaScript column for this.

 ![CleanShot 2025-03-04 at 07.45.04@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/b/db73adb9e19c929173518213df4dd85e58cc5674.png)

Each would contain a function like this:

```auto
function extractComponent(inputString, component) {
    // Define a regular expression pattern to extract all parts
    const pattern = /(\d{4}-\d{2}-\d{2})\s([a-zA-Zà-ùÀ-Ù]+)\s(\d{2}:\d{2})\s([\w\s]+)\s(\d{7})/;
    
    // Execute the regular expression on the input string
    const matches = inputString.match(pattern);

    // If there are matches, extract the required component
    if (matches) {
        switch(component) {
            case 'timestamp':
                // Return the full timestamp (date + day + time) exactly as it is
                return `${matches[1]} ${matches[2]} ${matches[3]}`;
            case 'location':
                // Return the location, trimming any extra spaces
                return matches[4].trim();
            case 'id':
                // Return the ID
                return matches[5];
            default:
                return null; // Return null if an invalid component is requested
        }
    } else {
        // Return null if no matches are found
        return null;
    }
}

return extractComponent(p1, p2)

```

Then you pass p1 and p2 like this.

 ![CleanShot 2025-03-04 at 07.48.12@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/b/1b0fa44967382c78fee36b1180d92cb5d253608d.png)

p2 can be “timestamp”, “location” or “id”.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 4, 2025, 1:06am UTC](https://community.glideapps.com/t/lock-choice-component-to-user/80285/18 "2025-03-04T01:06:43Z")

</div>

Looks like @ThinhDinh beat me by minutes, but this is what I came up with. Somewhat similar, but a slightly different approach. I only did one javascript column, but split the values afterwards. I put it into a template app so you can copy it and see how I set up the columns.

> **[Ralf Example](https://go.glideapps.com/template/8SQnKHUWjA1wzVWaQ89z-template-published?privateTemplateToken=xcvFnlJeQo30lkGGDauk)**
