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.
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?
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.
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?
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).
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.
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.
Totally doable from Glide, even if all are in a single table
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).