Ciao a tutti,
I need to delete rows based on a logical VC [Dup.] (true/false) from table CassettoFiscale.
No problem if I create a data action as follows cancellaDuplicati (action)
Since I want to call this action "outside" of a single record, I've a table called triggerAzioni with a single record and some logical fields in order to launch different actions on the CassettoFiscale table. Using a specific detail view based on table triggerAzioni the user can "switch" from false to true one ore more logical fields and, for each field, there is a Bot listening for the updated value and starts the related data action.
One of them, called eliminaApici, finds/replaces single quotes at the end of multiple fields and runs with no problems.
The one which has to DELETE records based on the condition [Dup.] = TRUE doesn't work, and produces the following error:
Error encountered in step with name [run_cancellaDuplicati]: Error: 'Execute an Action on a Set of Rows' Data action 'Action for run_cancellaDuplicati' for table 'triggerAzioni failed with exception Index was outside the bounds of the array
I have tried to substitute the VC with a phisical field: same error.
I have tried different Bot configuration: Run action on Rows both calling the built-in Delete action and calling an "hand-written" Delete action.... always the same error.
The list of referenced rows is populated exactly by the record IDs I need to delete...
Any help will be extremely appreciated.
Regards.
Massimo
The reason this doesn't work is that the Referenced Rows is a list of ID's that are then "iterated" over using an Index. When rows are deleted, it changes both the index positioning and total item count - both required to properly navigate a list to be processed.
Alternatively, if the row can be deleted as soon as you mark the row with [Dup] = TRUE, then you can setup a Bot that triggers when a row is that condition. The Bot will then process each row delete individually of the others and avoid the indexing problem.
If you cannot delete as soon as [Dup] = TRUE, then add a [Delete?] column, use your Action above to set the [Delete?] column instead of the physical delete action. Then create the Bot triggered when [Delete?] = TRUE.
Ciao,
thanks for your prompt help!
I have the following workflow to manage digital invoices:
When an updated CSV is available, I repeat step 1 and step 2 and, using the VC [Dup.], a piece of code computes which rows are duplicated (if any).
My goal is to keep only the first occurrence of each record and delete all the duplicates (if any) coming from subsequent CSV file import.
I'm facing problems in moving from single "manual" tasks (import, cleanup fields and remove duplicate) to a clean automated workflow.
Your suggestion of deleting a row as soon as [Dup.] = TRUE is unstable, probably due to the fact that the VC can change from FALSE to TRUE as the result of the Action which cleans the "dirty" single quote. The action runs automatically (with success) on multiple rows and is started using a Bot which "listen" for a TRUE/FALSE field in another table.
Today I will try your second suggestion, assuming that the [Delete?] column has to be phisical, not virtual.
I will let you know....
Regards.
User | Count |
---|---|
36 | |
8 | |
3 | |
2 | |
2 |