Custom Action with multiple Set Column Value actions

Hello there,

I have created an app for an event company where they can approve vendors for 3 different farmers market events.

As part of the functionality, we need to provide a way for a user to deny a vendor from participating in the markets.

I have created a Deny Vendor button that needs to run the following actions:

  • Set Column Values of Deny Vendors? to ā€œDeniedā€
  • Clear values of 3 cells on Org Name Relation- South Pearl using Set Column Values
  • Clear values of 3 cells on Org Name Relation- Central Park using Set Column Values
  • Clear values of 3 cells on Org Name Relation- Highlands using Set Column Values

The Org Name Relations are relations to three separate sheets for the different farmers market events where I am clearing the Business Name, Contact Name, and Email address of a vendor that has been previously added to the respective list.

Here is what I have set up for the Custom action:

This setup will add ā€œDeniedā€ to the targeted cell but is not currently clearing the values on my relations. It seems that if I only have one of the Set Column Value for clearing the Org Name Relation cells it will successfully run. The problem seems to be with adding more than one Set Column Value action.

Itā€™s almost like it will only run the first Clear values in my sequence and stops after completing the action.

Do actions in a Custom Action run in succession? Is there a different way I need to structure my sequence?

Appreciate any guidance here!

1 Like

It should work as you have it, as long as all 3 relations are intact.

How are you creating the relations?
If you view the data prior to initiating the action, can you see that the relations are formed?

Yes, the relations do exist in some scenarios and are working properly when they do.

In some cases, there will not be a relation formed as this happens when a vendor is approved. We will need to be able to Deny a vendor before any vendor is in the approved state (before a relation is formed), as well as if they have any of the 3 separate relations.

I have also tried setting up the Custom action like this:

If you canā€™t guarantee that the relations will always be formed, then this is probably a better way to set it up. In my experience, once an action in a sequence fails, then no further actions will be executed.

Again, how are the relations formed? Are the values being matched static and stable?

When a vendor is approved, a new row is created on the respective market spreadsheet with the Business Name, Contact Name, and email address for the vendor.

A relation is then formed between the Business Name on this sheet and the Business Name in my main database that contains all vendors.

Here is a screenshot of my main database:

And a screenshot of one of my market spreadsheets where the data has been added after a vendor has been approved:

So you are matching name to name?

Whilst that should work fine, one thing I would recommend is adding a RowID column to your main database table, and use that as a foreign key to link to any secondary tables. Whilst it shouldnā€™t make any difference in this case, it will give you a more robust solution and will eliminate the chance of things breaking if (for example) a business name is ever changed.

Other than whatā€™s already been said, I donā€™t have much else to offer, sorry. In theory, what you have should work fine, I believe. There have been issues reported from time to time with custom actions, so Iā€™m not sure that they are 100% reliable 100% of the time. In particular, multiple Set Column Values through single relations (exactly what you are doing here) can sometimes be problematic.

If nobody else jumps in with any ideas, it may be worth your while submitting a ticket with Glide Support.

Just a side note: The appearance of ISO-8601 values in your date column suggests that column may not be correctly formatted as a date/time column type, which could give you problems if you ever try to use that column in other computed columns (eg. with date math). You can check/confirm this by editing the column in the Glide Data Editor and checking the column type (even though the icon suggests date/time, that wont always be the case if the column was originally created in a Google Sheet).

1 Like

Actually, I just had a thought.
Do each of the South Pearl, Central Park and Highlands tables share a common structure? ie. similar set of columns?
If they do, it may be worth your time to think about combining those into a single table. As well as reducing the need for multiple Set Columns via Single Relation, it could have additional benefits in terms of simplifying your app.

Hey Darren,

Thanks for the advice! I see how that will improve my database, make relations a bit more straightforward, and mitigate any errors since we are extending the feature for a company name to be edited.

I would have to agree that the custom actions are not reliable in this case. I have noticed that operations are not running on the initial click on some of my other custom actions and that you have to click multiple times in order to have the action performed.

I will get with Glide Support and see what they say in regards to how I am using the custom actions.

Appreciate your help!

1 Like

Unfortunately, I have to maintain separate tables because we need to allow for each table to be exported as a CSV.

The only way I have found to do that is through setting an Open Link action with an export URL for the unique GID of the sheet.

Example:

<link_to_google_sheets>/export?format=xlsx&gid=<sheet_id>

https://docs.google.com/spreadsheets/d/14nA5-DV6_8FwR7Q6c8UY6EPB7YpqooQ8EYy2Tm11Dr8/export?format=xlsx&gid=1863657158

Totally doable from Glide, even if all are in a single table :wink:

Hereā€™s a tutorial that shows how to generate a CSV export from Glide.

To split them up for export, all you need to do is create a relation that only includes the rows of the appropriate category, and then fetch a joined list of rows through that relation (I think I described how to do that in the tutorial).

2 Likes