# Profile Pic using Data (if/then)

**URL:** <https://community.glideapps.com/t/profile-pic-using-data-if-then/11567>\
**Category:** Report a Bug\
**Created:** [June 28, 2020, 12:25am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567 "2020-06-28T00:25:02Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![spencersRus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spencersrus/32/69_2.png) [@spencersRus](https://community.glideapps.com/u/spencersRus)\
**Post date:** [June 28, 2020, 12:25am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/1 "2020-06-28T00:25:02Z")

</div>

Is there currently a way to bring in an if/then column into the User Profile.

Case:  
I have enabled user profiles.  
In the Data Editor I have two columns.  
ONE: Default Selfie (a default avatar given to every user)  
TWO: Selfie Upload (a place to upload a selfie, if you want to)  
Then an if/then column that shows the Default Selfie if the Selfie Upload is empty.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/f/f60f3e523368d9d852e575d093d3404579c247c8.png)

Is there currently a way to make this if/then column **THE** selfie in the profile?  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/1/10e808797b6d82f860f00b35b05d29c782e9610f.png)

Right now it only seems to be pulling from the sheet and not the created columns in the Data Editor.

(this seems like something @Robert_Petitto would have some sort of work around.)

(it also seems like a feature request)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 28, 2020, 1:04am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/2 "2020-06-28T01:04:04Z")

</div>

Hi Spencer,

What an awesome use case. I guess the only way to do this (Currently) would be to have an if/then formula in the sheet IN ADDITION TO the if then data column.

I say “addition to” only because the if then data column is instant and provides a better UX, and the formula in the sheet, although redundant, will allow for this functionality.

---

<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:** [June 30, 2020, 12:58am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/3 "2020-06-30T00:58:35Z")

</div>

I think you are going to run into issues because the user profile image needs to be an editable column. An if/then column probably wouldn’t be recognized because of this, but you also run the risk of breaking an arrayformula if you attempt to do the formula in the sheet. I think a script would be the only way. The script would add the default image url to any row that does not have one set. When a user changes their image, then it updates and the script will not touch it because it’s filled in already.

---

<div class="post-metadata">

**Author:** ![Cmstewart42](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cmstewart42/32/7319_2.png) [@Cmstewart42](https://community.glideapps.com/u/Cmstewart42)\
**Post date:** [July 3, 2020, 12:03am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/4 "2020-07-03T00:03:30Z")

</div>

@spencersRus,

I think the if else solution would work fine. The default pic column simply has an array formula that fills each new row with a default pic url then the user provided pic fills the next column. Then using an if else column that simply checks if the user pic column is empty. If empty use default column link, else use the user provided link.

Pleaseet me know how it works out!

---

<div class="post-metadata">

**Author:** ![spencersRus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spencersrus/32/69_2.png) [@spencersRus](https://community.glideapps.com/u/spencersRus)\
**Post date:** [July 3, 2020, 1:30am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/5 "2020-07-03T01:30:16Z")

</div>

The solution works fine for the **DISPLAY** in the app.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/5/575c6a9d09bc4fd627961606aea49df0f5b1f03e.jpeg)

But not the **actual** Profile  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/c/c591a04bc03da4400c7f5664c91fc9188e8429f6.png)

---

<div class="post-metadata">

**Author:** ![Cmstewart42](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cmstewart42/32/7319_2.png) [@Cmstewart42](https://community.glideapps.com/u/Cmstewart42)\
**Post date:** [July 3, 2020, 1:36am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/6 "2020-07-03T01:36:49Z")

</div>

And the profile is set to look at the if else column?

---

<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:** [July 3, 2020, 1:43am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/7 "2020-07-03T01:43:09Z")

</div>

It’s not available to be set, I think.

---

<div class="post-metadata">

**Author:** ![Cmstewart42](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cmstewart42/32/7319_2.png) [@Cmstewart42](https://community.glideapps.com/u/Cmstewart42)\
**Post date:** [July 3, 2020, 1:43am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/8 "2020-07-03T01:43:56Z")

</div>

Should be. in the glide editor navigate to profile and select the tab display then the 3 columns appear image, name and email should be able to be set to any column

---

<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:** [July 3, 2020, 1:44am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/9 "2020-07-03T01:44:49Z")

</div>

But at the top, Kevin showed that it’s not available for selection.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [July 3, 2020, 1:44am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/10 "2020-07-03T01:44:51Z")

</div>

@Cmstewart42 User Profiles only looks for spreadsheet columns, not data columns

---

<div class="post-metadata">

**Author:** ![Cmstewart42](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/cmstewart42/32/7319_2.png) [@Cmstewart42](https://community.glideapps.com/u/Cmstewart42)\
**Post date:** [July 3, 2020, 1:45am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/11 "2020-07-03T01:45:30Z")

</div>

My apologies. Missed the image above!

---

<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:** [July 3, 2020, 1:45am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/12 "2020-07-03T01:45:54Z")

</div>

So would an If \> Then formula in sheets work? That should be the way albeit we still want to do it in Glide.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [July 3, 2020, 2:02am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/13 "2020-07-03T02:02:47Z")

</div>

Right:

> [@Profile Pic using Data (if/then)](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/2):
>
> Hi Spencer, What an awesome use case. I guess the only way to do this (Currently) would be to have an if/then formula in the sheet IN ADDITION TO the if then data column. I say “addition to” only because the if then data column is instant and provides a better UX, and the formula in the sheet, although redundant, will allow for this functionality.

---

<div class="post-metadata">

**Author:** ![spencersRus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spencersrus/32/69_2.png) [@spencersRus](https://community.glideapps.com/u/spencersRus)\
**Post date:** [July 3, 2020, 2:15am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/14 "2020-07-03T02:15:13Z")

</div>

So what is the spreadsheet magic that will create an if then for each profile as it is created.  
(Without the app thinking it is an extra 9999 rows?)

---

<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:** [July 3, 2020, 2:16am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/15 "2020-07-03T02:16:16Z")

</div>

```
=ARRAYFORMULA(IF(B2:B<>"",B2:B,IF(A2:A<>"",A2:A,"")))

```

Assuming you store the default image in column A and the newly uploaded image in column B.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [July 3, 2020, 2:20am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/16 "2020-07-03T02:20:25Z")

</div>

something like this:

```auto
={"Default Image";arrayformula(if(len(A2:A), A2:A, "https://AVATARURL.com/"&B2:B))

```

Where A2:A is the image upload and B2:B is a unique ID to the user profile. Email address or Row ID. Avatar URLs can be any of the ones we found here:

> [@Avatar Builders!](https://community.glideapps.com/t/avatar-builders/7964):
>
> Creating this thread to highlight innovations to avatar builders within Glide. This first one comes from

---

<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:** [July 3, 2020, 2:45am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/17 "2020-07-03T02:45:53Z")

</div>

You can do that, but if someone chooses to change their image through the user profile, it will break the arrayformula. If I understand correctly, @spencersRus wants the image to show in the user profile with either the default image or a user uploaded image.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/1/19dde504d4560c3c78cf8d1595e6b55ec6e52a24.png)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [July 3, 2020, 2:47am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/18 "2020-07-03T02:47:14Z")

</div>

Ah…I see the dilemma now. I’ll need to chew on this a bit.

---

<div class="post-metadata">

**Author:** ![spencersRus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spencersrus/32/69_2.png) [@spencersRus](https://community.glideapps.com/u/spencersRus)\
**Post date:** [July 3, 2020, 2:48am UTC](https://community.glideapps.com/t/profile-pic-using-data-if-then/11567/19 "2020-07-03T02:48:57Z")

</div>

Exactly @Jeff_Hager My original thinking (not knowing too much about the glide code or the spreadsheet magic) was that I thought that it would be good if we could create a data column that would fill in a default image (through Template and/or If/Then).

But I found out that it was not an option. Thus the original question.
