Handling record creation error

Hi,

Is there a way to handle table record creation error (eg.: I want to insert same value in ID field that already exist.

My usecase:
User can create record based on values from other tables (SkuId and LineTypeId). I’m using combination of these two fields to create unique ID in another table - for this case is not important for what this table is used.

User can then edit data if record based on unique Id (SkuID + LineTypeId) is already in table (showing edit step) or add new record (using Add step) if record does not exists.

So it can and will happen that user will use Add step and step will show error that Id already exists. I would like to close (or not open Add step in the first place) if created record produces error (id already exists).

So long question short: Can create record error can be handled in triggers? This functionality is useful in various scenarios.

Thank you.

hello @ermingut, are you familiar with the If Conditional has record with ID?? (you can place anything you’d like in the Expression, including ID’s from other 2 Table Records):

based on what I’m understanding, this should help you solve the problem. let me know if this is indeed the case!!

Follow up: Above functionality can be achieved using Query based on app variables and count aggregation. This workaround is not best approach because this is creating unnecessary table access and possible performance problems on larger tables.

@gio thank you for your proposal. I will try it out.

great, let us know how it goes @ermingut!!

As I can see this functionality is only available on step triggers. I can not use it on button (eg: showing different step based on record exists condition)

Anyhow this should be sufficient.

I can change logic a little.

Ermin

@ermingut just to clarify, what type of button are you referring to (is it a Row Selected on an Interactive Table or an actual Button)??

I am seeing it show up on my end (note this is on a Button press):

I really don’t know what happened. Unfortunately I did not make print screen to show you. I can see Table as option in button press now.

Thank you.

Edit: I can see now what happened.

If I use one of already used conditions in “If” part of trigger some options are hidden:

If I create new condition all options are avaiable:

image

Ermin

1 Like