# Pulling select data based on previous conditions

**URL:** <https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460>\
**Category:** Ask for Help\
**Created:** [January 20, 2022, 12:32pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460 "2022-01-20T12:32:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walleya](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@Walleya](https://community.glideapps.com/u/Walleya)\
**Post date:** [January 20, 2022, 12:32pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460/1 "2022-01-20T12:32:42Z")

</div>

Hello all,  
I have been using the Glide app for around 24hrs so just getting to terms with it. So far so good

The query i have is the following

I have 2 stores who sell the same products but make 2 different profits  
Product is identified by a SKU code

I am using a form by the sales staff to log their sales.  
However what i would like to happen is the form auto populate the Revenue made, based on the sales staff selecting which store they work in and the SKU entered

I have a sheet which has all the sales date ( item, description , monthly fee ) and there is a column each each store.

My question is this possible?  
I have attached a few images to hopefully help explain.  
Thanks in advance for your help

Adam

 ![Rate Card](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/4/d480962971e21af1ee374b477c5f3abaf4b55430.png)

---

<div class="post-metadata">

**Author:** ![Walleya](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@Walleya](https://community.glideapps.com/u/Walleya)\
**Post date:** [January 20, 2022, 12:33pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460/2 "2022-01-20T12:33:44Z")

</div>

![App](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/c/9c5518d3f46d1331f0930e7682e2c4426861ea1c.png)  
This is how the app looks,  
Ideal plan is once Store is selected it will put in the Value under that store name

---

<div class="post-metadata">

**Author:** ![Marc-Olivier](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@Marc-Olivier](https://community.glideapps.com/u/Marc-Olivier)\
**Post date:** [January 20, 2022, 12:38pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460/3 "2022-01-20T12:38:10Z")

</div>

Hello  
The form is perfect for that you can populate automatic data that comes either from the user or from the store (revenue made, specific profit margin, etc …).  
To do so in the form when you press the + button you have to select either the data from the screen columns or/and from the user.  
The trick is to get the get the right screen column datas and to achieve that, place your form button in the right spot in the app or get the datas you need through relations and Lookup.  
Let me know if you need further explanations.

---

<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:** [January 20, 2022, 1:04pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460/4 "2022-01-20T13:04:53Z")

</div>

If each sale here is uniquely identified by a combination of Store and SKU, then you can:

- Create a relation in the Sales table, relate the SKU submitted to the SKU table. This should be a single relation.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/a/4a504a00c2470426023eef9a8d3b0ea1e7d4de4b.png)

I assume the image above is your SKU table and SOC Code is the SKU.

- Use two lookup columns to return “Ashton” and “Hyde”, which I assume are two values that represent the revenue based on the store name.

- Create a final If Then Else column in the Sales table to represent the revenue. If Store is “Ashton” then return the “Ashton” lookup, else the “Hyde” lookup.

---

<div class="post-metadata">

**Author:** ![Walleya](https://avatars.discourse-cdn.com/v4/letter/w/3da27b/32.png) [@Walleya](https://community.glideapps.com/u/Walleya)\
**Post date:** [January 20, 2022, 5:15pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460/5 "2022-01-20T17:15:01Z")

</div>

Thank you very much for your reply. I will work on trying to get this set up.

Many thanks  
Adam

---

<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:** [January 20, 2022, 11:42pm UTC](https://community.glideapps.com/t/pulling-select-data-based-on-previous-conditions/37460/6 "2022-01-20T23:42:11Z")

</div>

Let us know if you need any further help!
