Error handler and Array Aggregator

Hello,
When you want to create a record in Salesforce and it detects a duplicate, it generates an error. I use the error handler attached to this initial module to branch my scenario and therefore update existing record and report them on a spreadsheet.
Because i work with German characters, sometimes it is not possible for me to update an existing record. I want add them into another google sheet.

At the end of the ingestion, IF there are some record impossible to update I want to send a slack message indicating how many lead need to be updated manually.
I am using an array aggregator to make sure all the row are added but for some reason I receive one slack message/ row instead of at the end of the scenario.
I suspect It is because the route start via the error handler but I m not sure and I don’t know how I could make this work.
Any idea?
Thanks

Hi @MVP_N,

Maybe you could aggregate the array with ‘Watch New Rows’ as a source and filter out results by ‘Add a Row’ bundle being >0 or something, meaning it has been activated. So you don’t get all results in the final array.

see imported script :
aggregateintheend.json (20.9 KB)

hi @kudracha,
Thanks for your reply, unfortunately I cannot access “Watch New Rows” from my array aggregator


I suspect it is because the beginning of this route (from the first Salesforce Module) is an Error Handler route to which i added a router to continue the scenario

Aha.

So the solution might be to :

  • Attach Ignore directly to ‘Create Lead in SF’, and
  • Instead of error handling route continue normally after creation module,
  • Filter out before ‘Search existing’ :
    • {if Lead ID does NOT exist from ‘Create Lead’}, meaning it has not been created.

It doesn’t work unless i do it wrong :slight_smile:
Here is the scenario you suggest:


Here is the filter:

Now for context, the reason the SF module will through an error is BECAUSE the record exists. If it exist then it s a duplicate therefore it stops the scenario.
If I add an ignore handler it will not continue the scenario (and go to the search record) it will try to ingest the following row and so on

These are the error message i get basically indicating that a record exist so it stops and goes to the next line.
when attaching to the error handling route I am able to “continue” the scenario via an “unofficial” route

@MVP_N , What are field values? Can you filter out using some ID or other data instead of ‘Exists’ ? Like {field != emptystring} or !=0 ? If it doesn’t work, please post last filter history data.

@kudracha the field value are the value i input when creating the record


on the log you can see the input field that the module was planning to input and the Handled Error indicating that the record already exist (use one of these record)

I know there is an Upsert Module to either update or create a new record but i get similar results

@MVP_N , Please look at this example of scenario :

errorhandlingtest1.json (7.2 KB)

When the module gets ignored, there is no output for modules that come after. The output you’re seeing is only for debugging and error handling.

If data exists, it means that create record has been ran, so you don’t need to continue. If data doesn’t exist, you continue. So you can filter out before ‘Search’ if data DOES NOT exist, for example idk length of First Name is 0 or First Name is not emptystring… be creative :slight_smile:

Thanks @kudracha,

Using your example, let say your JSON has 10 value and only 6 would pass the Json Parse to arrive in module 9,

How would you do to:

  1. Record the variable ignored (this I manage to do)
  2. Send 1 slack message to indicate that out of all the ingestion, 4 error were detected and recorded in a spreadsheet
    The difficulty here is to send only 1 slack message and only if we have detected errors

@MVP_N ,

Data input : [1,2,3,4,5,6,7,8,9,10]
In which : 1,2,3,4,5,6 are valid and others generate error.

If I understand correctly, you want to record 7, 8, 9, 10 and aggregate their names to finally be used in slack message.

After the JSON parse, use a router with 2 filters :

  1. parsejson OUTPUT Exists
  2. parsejson OUTPUT Doesn’t exist
    (Note : not literal ‘Exist’ but maybe other type of filter to achieve this)

If output doesn’t exist, it means that error has been generated before and it nulled the output. So we put here a ‘Text aggregator’ module with source being Repeater and with value {{outputjson.name}}, with a comma and it’ll generate 7,8,9,10.

thank you for your help @kudracha,
I understand the logic, will try to apply it.
As I ingest a spreadsheet with watch new row i need to determine how many new rows will be added to have the number of value for my reaper before trying the text aggregator

Hey @kudracha

Just so you know, I’ve managed to fix my problem inspired by your answer with bits and bobs from other threads :slight_smile:


The solution was:
Instead of Watch module for sheet have a Search module where i can count the number of new row to add
Bring forward the search module before creating a new one so that i can have a router to either create or update
Have my ignore handler route still in place to capture lead that exist but cannot be updated (won’t enter into too much detail but SF module in Make has difficulty to understand that ü and ue are the same for eg)
Create a separate route from my router with an aggregator array linked to the sheet module so ensuring all the row have been ingested no matter their status (created, updated, problem)
Retrieve my variables from my different end points, create my slack message indicating the number of value for each case.

Thank you so much for your help!