Question

Channel error on "Formatted Reference Range"

  • 27 March 2023
  • 1 reply
  • 59 views

Badge +4

I’m working on a Email Channel that has this “Record to Update - Formatted Reference Range” - currently I’m running Debugger with the lines commented out below.

 

Now with the lines uncommented, I get the error - I don’t quite understand why I’m getting this error.

 

Just in case this helps with the initEventListSrch…

 


1 reply

Userlevel 3
Badge +6

The TooManyRowsException is being hit due to the search criteria not resolving to a single Event in assyst. The Formatted Reference Range provided is empty, and so this is effectively attempting to bring back all Events in the system.

If the search should be completely skipped if a certain condition is met, in this case the initEventListSrch bringing back 0 results, this should be in the “Skip Search When:” expression.

It is worth noting that the search for the Record to Update field can only support returning 1 exact result, so if the initEventListSrch brings back multiple results, it will still hit the TooManyRowsException. In my above example, I skip the search if either the “To” Email Address doesn’t match a specific value or if the initEventListSrch list length is not exactly 1.

Skip search when:

var skipSearch = false;
if (common.extractEmailAddress(headers['To']) != "automated@helpdesk.com") {
skipSearch = true;
} else if (variables.initEventListSrch.length != 1) {
skipSearch = true;
}
skipSearch;

If the intended behaviour of the Channel is to update a dynamic number of Events then you may need to use an Iterating Datamapper to perform an update for each Event in the initEventListSrch list.

https://wiki.axiossystems.com/assyst11-6Wiki/index.php/Integrations:assystETM_1.6_-_Channel_Configuration#Iterations

Reply