# Linking staging tables and custom actions

**URL:** <https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313>\
**Category:** Ask for Help\
**Created:** [September 12, 2024, 6:38am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313 "2024-09-12T06:38:46Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 12, 2024, 6:38am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/1 "2024-09-12T06:38:46Z")

</div>

Hi all

I’m trying to achieve the below:

_Create plan_  
When a user taps ‘create plan’  
Then set the column values in Plans\_working accordingly  
And navigate to a new screen with Plans\_working data

_Create section_  
Given a user is on the create plan screen with Plans\_working data  
When a user taps ‘create section’  
Then set the column values in Sections\_working accordingly  
And navigate to a new screen with Section\_working data

i.e. the ability to create a plan with multiple ‘sections’.

I’ve been assuming I need to link plans\_working to sections\_working with a relation to do this - which I’ve done by linking a templated version of the ‘current user’ (user profile Row ID).

However I’ve noticed that when I do this, and I set up the custom action as per the screenshot below, the ‘create section’ button disappears from the display for the user. I’m not sure why?

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

Screenshot below of how the relation in plans\_working is set up:

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

In case it’s relevant, this is how ‘temp plan ID’ is set up in plans\_working:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/7/37e2c3efc1c705866098af135e4ca374516ea2e7.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 12, 2024, 12:13pm UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/2 "2024-09-12T12:13:47Z")

</div>

Is your relation column actually matching anything?  
In your second screen shot, it appears to be empty.

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 12, 2024, 6:45pm UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/3 "2024-09-12T18:45:07Z")

</div>

Yeah this was confusing me too admittedly!

So there is 1 row for plans\_working and 1 row for sections\_working. I’ve linked them with the user ID.

Maybe I’ve mis-used the relation, but I imagine it’s turning up blank because the rows are empty? My assumption was that linking them by user ID would at least let the button be visible - then when the user taps the button, Temp plan ID is set in sections\_working based on the same in plans\_working.

Is there a better way to link two staging tables so that, whilst creating a plan, one can create a section within that plan?

plans\_working:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/2/725ebe4059295a4dedfea73832bd209150f88429.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/0/60ec238f97b9bd2d696eb0fd0967e8ccaf01f4eb.png)

sections\_working:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/e/2eada2df9ccfac58c500f72ce11a0a81eb8e770f.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:** [September 12, 2024, 7:43pm UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/4 "2024-09-12T19:43:56Z")

</div>

Are there any extra spaces in either one of your template columns that may be causing a mismatch for the relation?

The easier alternative, since these are single row tables, is to use a Single Value → Whole Row column instead of a relation. Then you don’t need template columns since you would be directly getting the first row from the Sections table.

---

<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:** [September 12, 2024, 11:51pm UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/5 "2024-09-12T23:51:57Z")

</div>

If I understand this right, it’s like a form in form situation. What I usually do is set a unique ID on entry to the form, then add that ID to the child table to create a relation.

I almost always use a custom form for this, so I can create a collection of added child rows right on the custom form.

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 14, 2024, 7:33am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/6 "2024-09-14T07:33:36Z")

</div>

In theory there ought to be no extra spaces as the custom actions clear all values for most of the columns except DATE and Temp Plan ID. Also the staging tables, i.e. plans\_working and sections\_working, are linked by a templated version of the user profile ID so I guess it won’t introduce a space there.

As for the single value, that makes sense! I tried the below and got stuck however:

- set up SV column in Sections\_working which pulled the whole row from the Plans\_working
- this made the button visible again (woot!)
- attempted to find a way to transfer this temporary ‘ID’ to the Sections table when the user saves the section, but it looks like SV columns don’t come up as an option when adding new rows (I guess because they’re computed columns)

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 14, 2024, 7:38am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/7 "2024-09-14T07:38:11Z")

</div>

@ThinhDinh correct, I’m going for a form-in-form situation 🙂

That unique ID for plans\_working could presumably be row ID? I just tried changing the custom action for the button on plans\_working so that it sets temp plan ID for sections\_working to the row ID of plans\_working, but the button didn’t appear when using that method.

Speaking of custom forms, I tried to use Darren’s [custom form](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014) concept but I can’t seem to copy it - is there another tutorial somewhere on custom forms?

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [September 14, 2024, 11:29am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/8 "2024-09-14T11:29:00Z")

</div>

A custom form is just a one row table with a bunch of user specific columns to hold the inputs.

From there you can create logic that prevents the submission of a button or makes calculations in real time.

---

<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:** [September 14, 2024, 11:59am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/9 "2024-09-14T11:59:04Z")

</div>

> [@rathbala](#):
>
> set up SV column in Sections\_working which pulled the whole row from the Plans\_working

Wasn’t your relation created in the Plans table to link to the Sections table. I was thinking the Single Value column would be in the Plans table, because it would mimic what your relation was doing.

> [@rathbala](#):
>
> this made the button visible again (woot!)

This is where I start to get confused. Just thinking about your original setup, it seems you now changed your approach. How is the button now showing? Did you remove the set column action?

> [@rathbala](#):
>
> attempted to find a way to transfer this temporary ‘ID’ to the Sections table when the user saves the section, but it looks like SV columns don’t come up as an option when adding new rows (I guess because they’re computed columns)

After reading this part, it started to make sense, but now I would say, why bother linking the tables at all. If your whole goal it to get the temp ID from the Plan Table to the Section table, then you only need a Single Value column that specifically grabs that one column from the plan table instead of grabbing the whole row. You also don’t need the user specific temp ID column in the section table because you’ll already have it with the single value column.

No template columns, no relations, no whole row single value columns, and no set column action. Just create one single value column to get the temp ID from the plan table into the section table. That should be all you need.

---

<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:** [September 14, 2024, 12:03pm UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/10 "2024-09-14T12:03:27Z")

</div>

> [@rathbala](#):
>
> That unique ID for plans\_working could presumably be row ID?

Don’t do that. The row ID in your working tables won’t change. Great for the first plan, but subsequent plans will then have the same ID derived from the row ID which doesn’t change.

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 16, 2024, 6:22am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/11 "2024-09-16T06:22:21Z")

</div>

Thanks Jeff - I might not have been clear in my earlier responses, but for clarification I have the below tables:

Plans (holds all user-created plans - multiple rows)  
Plans\_working (working table when creating a plan - single row)  
Sections (holds all user-created sections - multiple rows)  
Sections\_working (working table when creating a section - single row)

Hence why I can only use Single Value for plans\_working and sections\_working.

As my core requirement is to let the user create a plan with multiple sections, I figured I’d need to link plans\_working and sections\_working since ideally a user could create a section (or multiple sections) whilst they’re creating a plan.

Another thing I could do is link plans and sections\_working so that in the UI the user has to create a plan first, before being able to create sections - I’m easy on the approach, but the one above seems to seem most intuitive.

Hope that clarifies! Any assistance would be most welcome 🙏

---

<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:** [September 16, 2024, 11:20am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/12 "2024-09-16T11:20:53Z")

</div>

If you create a single value column in the sections-working table that gets the plan ID from the plan-working table…doesn’t that accomplish your original goal?

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 17, 2024, 7:10am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/13 "2024-09-17T07:10:15Z")

</div>

Yeah that gets the ‘add section’ button to appear on the screen based on plans\_working data, which is a step forward 🙂

However, how might I transfer that single value column’s value to Sections when the user hits the ‘submit’ button on the screen with sections\_working data? At the moment the ‘Add row’ action in the custom action creator doesn’t show the single value column as a choice…

By the way, I think the aforementioned ‘add section’ button appeared because previously I had the custom action for ‘add section’ be in this order:

- set column values in sections\_working, to clear all columns (based on a relation between sections\_working and plans\_working, linked by the templated user ID)
- go to new screen with sections\_working data

But now it’s in this order (i.e. the other way around):

- go to new screen with sections\_working data
- set column values in sections\_working, to clear all columns (based on a relation between sections\_working and plans\_working, linked by the templated user 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:** [September 17, 2024, 12:03pm UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/14 "2024-09-17T12:03:06Z")

</div>

> [@rathbala](#):
>
> At the moment the ‘Add row’ action in the custom action creator doesn’t show the single value column as a choice…

If the single value column is not showing as an option, then something isn’t configured correctly, or not as expected. I don’t seem to have any issues using a single value column with an add row action. We’ll need to see some screenshots or a video of your setup showing how you get from plan to section, how the screens are set up, and how your chilling are set up.

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 18, 2024, 6:18am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/15 "2024-09-18T06:18:32Z")

</div>

EDIT: I think I’ve found the issue, please skip the below and scroll down a couple of posts…

* * *

Gotcha! Here are a couple of videos…

The Layout and Actions (here you can see that the SV column is missing when aiming to add a section i.e. the ‘Go’ button):

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/3/239102b6628f3eaaa7461e6e270d3d91c6987116.jpeg "Screen Recording 2024 09 18 at 07 04 05") ](https://www.youtube.com/watch?v=uvsUaUgOo7U)

The Data:

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/f/aff621daf9dc150ceaa14c022d11eef4f38ac2d1.jpeg "Screen Recording 2024 09 18 at 07 09 01") ](https://www.youtube.com/watch?v=XBDy5tQeKJM)

Hope that helps? Please shout if there’s anything missing.

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 18, 2024, 6:21am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/16 "2024-09-18T06:21:46Z")

</div>

Forgot to include this screenshot of the ‘draft section’ relation:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fcb3fa069d66791cbe681df32dbf89bca81086bf.jpeg)

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 18, 2024, 6:37am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/17 "2024-09-18T06:37:22Z")

</div>

Ah I’ve found the issue, apologies. I forgot to change the Single Value column in sections\_working to take just the temp plan ID from the plans\_working column. Also I’ve now replaced the temp plan ID in plans\_working so that it creates a unique ID instead of using the row ID.

I can now pick the Single Value column as an option in the custom action.

It’s weird that when I do this though, that the section doesn’t show up in the plan…as per below:

[![]( " - YouTube") ](https://www.youtube.com/watch?v=7je3IKFGo78)

[![]( " - YouTube") ](https://www.youtube.com/watch?v=lRrcpFLi64U)

---

<div class="post-metadata">

**Author:** ![rathbala](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rathbala/32/44552_2.png) [@rathbala](https://community.glideapps.com/u/rathbala)\
**Post date:** [September 19, 2024, 6:49am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/18 "2024-09-19T06:49:25Z")

</div>

Think I’ve finally cracked it 😃 Thanks @Jeff_Hager for nudging me along!

What I did:

- As mentioned, single value column should only refer to 1 column, not whole row, to make it visible in the ‘set column value’ options for the custom action
- Have a simple text column, user-specific, in plans\_working called ‘Plan ID’
- When the user then hits ‘create plan’ on the plans screen, set the column value of ‘Plan ID’ to a unique ID (instead of generating a unique ID with a template in plans\_working, as that would never change since it’s a single row table)
- Set up a ‘Sections’ relation which links plans-working’s Plan ID to sections’ Plan ID
- Put a custom collection in the plans\_working screen with the ‘Sections’ relation (also make sure there are no filters accidentally applied on this collection)
- Within the custom collection, add a collection that links the required items to sections, to show all the required information

Appreciate the patience. This is resolved now.

---

<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:** [September 26, 2024, 6:50am UTC](https://community.glideapps.com/t/linking-staging-tables-and-custom-actions/76313/19 "2024-09-26T06:50:08Z")

</div>

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