# Trying to learn data manipulation in Glide :-/

**URL:** <https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286>\
**Category:** Ask for Help\
**Created:** [April 8, 2023, 12:57pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286 "2023-04-08T12:57:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![OttoMan28](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ottoman28/32/56419_2.png) [@OttoMan28](https://community.glideapps.com/u/OttoMan28)\
**Post date:** [April 8, 2023, 12:57pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/1 "2023-04-08T12:57:15Z")

</div>

I’m still trying to wrap my head, around the way data manipulation is done in Glide.

In this a **thought up** example, I’m trying to construct a string. I have found two ways of doing it, either to process the stings in steps as in the red block or via Excel formulas.

1. First change Name to uppercase via the method “Other/Experimental/Text/Uppercase Text”
2. Then replace the Space with a – (dash) via a Template replace.
3. Now I load up the base-string from a Single Value pick (I like to have my “globals” in a collective store), formatted with [filename] and [ext] dummies.
4. Then I construct the final string by replacing the [filename] with ‘Place\_Dash’ and [ext] with “.jpg” via a Template-Replace (I know I could have saved the operation at 2 ‘Place\_dash’, by replacing the space here)

What I really don’t like about this approach, due to the many columns you potential could end up with.

Then I looked into doing it through the method “Other/Experimental/Code/Excel formulars.”

It’s a bit more effective, but I still end up with one extra column ‘pick\_single\_val2’ – how wonderful it would be if you could use the Single Value in the Excel formulars and/or in Actions on the forms/display. I’m a bit surprised that there is no programming attached to the Actions.

BTW please notice that not all Excel functions have been ported, e.g. Substitution() is missing, so i had to take the long road with Replace() and Find()

Do I miss something or is there another way of conducting data manipulation is done in Glide?

 ![Skærmbillede 2023-04-08 13.20.52](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b157f87a6e474ada2810d934d42b905389b19d4f.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:** [April 8, 2023, 2:32pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/2 "2023-04-08T14:32:39Z")

</div>

You could use the javascript column, similar to how you used the excel column. Your code would look a little cleaner and easier to understand.

As for the extra single value column, what you could do instead is utilize the user profile table as your collective store. Anything from the user profile is globally available throughout the app without having to use a single value column to bring it into other tables. The javascript column can pull in parameters directly from the user profile table.

---

<div class="post-metadata">

**Author:** ![OttoMan28](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ottoman28/32/56419_2.png) [@OttoMan28](https://community.glideapps.com/u/OttoMan28)\
**Post date:** [April 8, 2023, 8:25pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/3 "2023-04-08T20:25:51Z")

</div>

I’m no whizz at Javascript, but i forgot about my new best friend ChatGTP - he does a fine job translating my Python snippets 🙂  
So yes, JS is the way to go. It is super compact.

> return p1 + p2.toUpperCase().replace(" ", “-”) + “.jpg”;

Can you elaborate on what you mean about using the User profile table for global vars?  
I assume it will be only global vars, for the current user logged in??  
If it is to be a true global vars available to all users, e.g. a base URL, surely it needs to be in a settings/helper table? Or have i misunderstood it?

---

<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:** [April 8, 2023, 9:59pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/4 "2023-04-08T21:59:14Z")

</div>

If you utilize user profiles in your App and your users are signed in, then you can access values from the user’s user profile row all over the app in various ways.

Instead of using a Single Value column to bring a value into a certain table, and then using it in a javascript column for example, you can directly access the user profile value in your javascript column as a parameter.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/9/59bde07330d88974383156a6046122f122ee3097.png)

> [@OttoMan28](#):
>
> I assume it will be only global vars, for the current user logged in??  
> If it is to be a true global vars available to all users, e.g. a base URL, surely it needs to be in a settings/helper table? Or have i misunderstood it?

What I’m saying is that instead of having a separate table to hold global values, you can set up those column within your user table. You could use a template column so those global values are populated on every user row.

---

<div class="post-metadata">

**Author:** ![OttoMan28](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ottoman28/32/56419_2.png) [@OttoMan28](https://community.glideapps.com/u/OttoMan28)\
**Post date:** [April 8, 2023, 10:12pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/5 "2023-04-08T22:12:55Z")

</div>

Hi Jeff

> [@Jeff\_Hager](#):
>
> What I’m saying is that instead of having a separate table to hold global values, you can set up those column within your user table. You could use a template column so those global values are populated on every user row.

You lost me on that part. What you are telling me is:

```auto
Name Level Base-url
Jeff Expert example.com
Otto Newbee example.com

```

Thats an elegant solution. But how the devil do you, so that the template function works ‘vertical’ rather than 'horisontal?

---

<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:** [April 8, 2023, 11:16pm UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/6 "2023-04-08T23:16:17Z")

</div>

If you create a template column and just type some random text into it (not using any replacement values), it will put that same text on every row in the user table. So if you create a template column, name it ‘Base-url’, and type “[example.com](http://example.com)” into the template, it will be the same for every user row.

---

<div class="post-metadata">

**Author:** ![OttoMan28](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ottoman28/32/56419_2.png) [@OttoMan28](https://community.glideapps.com/u/OttoMan28)\
**Post date:** [April 9, 2023, 7:02am UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/7 "2023-04-09T07:02:54Z")

</div>

Wow ! That was a cool trick you taught me there.  
Thanks for the help.  
(Any more lifesaving tricks up your sleeve?)

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [April 9, 2023, 7:17am UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/8 "2023-04-09T07:17:31Z")

</div>

You can bulk manipulate columns with JSON files 😉

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 10, 2023, 7:17am UTC](https://community.glideapps.com/t/trying-to-learn-data-manipulation-in-glide/60286/9 "2023-04-10T07:17:45Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
