# Custom Action on Add

**URL:** <https://community.glideapps.com/t/custom-action-on-add/67633>\
**Category:** Ask for Help\
**Created:** [November 9, 2023, 2:39am UTC](https://community.glideapps.com/t/custom-action-on-add/67633 "2023-11-09T02:39:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_San](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dan_san/32/24085_2.png) [@Dan\_San](https://community.glideapps.com/u/Dan_San)\
**Post date:** [November 9, 2023, 2:39am UTC](https://community.glideapps.com/t/custom-action-on-add/67633/1 "2023-11-09T02:39:07Z")

</div>

Using the new platform, I have a LIST collection for which I have activated the add function.

Then I have the option on Submit to carry out further actions on Submit.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/8/b84c563f3b815e12c5889dc8dde364ed1ff55d0e.png)

In the custom action I want set values on the row that has just been added, but it is not working. IT doesn’t change the values of the original row that was added but it does seem to add another row with the same UUID as the original row

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/7/a72b5ae2e137ad99253deacaf296ce4c73ecd3bf.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:** [November 9, 2023, 2:49am UTC](https://community.glideapps.com/t/custom-action-on-add/67633/2 "2023-11-09T02:49:45Z")

</div>

Set Column Values on Form Submit is never a good idea. Sometimes it will work, and sometimes it won’t. The problem is that sometimes the Set Columns will fire before the new row has been added, and so there is nothing to update.

Much better is to pass whatever values you need with the Form itself. There are various ways to do that, depending on actual use case.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [November 9, 2023, 2:51am UTC](https://community.glideapps.com/t/custom-action-on-add/67633/3 "2023-11-09T02:51:09Z")

</div>

If you are using the Show Form Screen, which is Glide’s native form:

- There is no need to add another on-submit action and especially not one that would add a row or change values of the added row.
- I would avoid having write actions and update actions within the same custom action, even if you include a wait action in between. I would separate these in different custom actions.

---

<div class="post-metadata">

**Author:** ![Dan\_San](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dan_san/32/24085_2.png) [@Dan\_San](https://community.glideapps.com/u/Dan_San)\
**Post date:** [November 9, 2023, 3:33am UTC](https://community.glideapps.com/t/custom-action-on-add/67633/4 "2023-11-09T03:33:14Z")

</div>

Thanks guys. Yes using the native/default add form for the collection.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/c/1cf920abe904f1369723746ef073df1b5135a981.png)

Problem I have is that based on the input, I need to use relations and lookup to pull in some data and then based on that data I need to apply the IF/ELSE column  
AND then insert that data into a text column using the “default value” function.

However, it is not using the data that in screen but rather the first column row, so that the data inserted into the text columns is incorrect

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [November 9, 2023, 4:01am UTC](https://community.glideapps.com/t/custom-action-on-add/67633/5 "2023-11-09T04:01:30Z")

</div>

> [@Dan\_San](#):
>
> Problem I have is that based on the input, I need to use relations and lookup to pull in some data and then based on that data I need to apply the IF/ELSE column  
> AND then insert that data into a text column using the “default value” function.

That won’t work. When you are on a Show Form Screen, whatever data you input in the fields doesn’t yet exist in any table until the user hits submit. So you cannot actually compute any of the data until it is submitted.

I think you might need to create a custom form to compute data before it is submitted, courtesy of Darren:

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particula…

---

<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:** [November 16, 2023, 4:01am UTC](https://community.glideapps.com/t/custom-action-on-add/67633/6 "2023-11-16T04:01:59Z")

</div>

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