Custom Action on Add

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.

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

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.

2 Likes

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.
1 Like

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

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

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:

1 Like

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