[DONE] Searching for comment creator not working

Hi, I am fairly sure there is an issue with searching for a comment creator:


The above errors saying the search value in null:

[400] validation: Filtering value is empty, make sure to provide a search value for all specified filters

If you change the search to last edited it works:

[08:51:12.543] Action execution started.
[08:51:13.041] Collected 1 records.
[08:51:13.043] Action execution succeeded.

If you change the search to a script block, then the non-working looks like:

{ 
  
 
  {
      let numCollected = 0;

      // (0) assemble filters
      const filters = [{
    field_id: 361086,
    field_type: 'SINGLE_USER',
    match_type: 'equal',
    values: [].map((item) => ({ value: item })),
    type: 'contact',
  }];


      // (1a) retrieve records via the API
      const { data: { records, cursor } } = await tape.Record.getManyFiltered({ appId: 38446, limit: 500, filters: filters, }); 


      // (1b) keep track of num collected records
      numCollected += records.length;

      // (1c) update and push into collection variable
      record_collection_team_members.push(...records);

      
  // (2a) retrieve more records (page 2) via the API
  const { data: { records: recordsPageTwo } } = await tape.Record.getManyFiltered({ appId: 38446, limit: 500, cursor }); 


  // (2b) keep track of num collected records
  numCollected += recordsPageTwo.length;

  // (2c) update and push into collection variable
  record_collection_team_members.push(...recordsPageTwo);
  

      // emit success log event
      
    }

    
   
 }

and I would have expected something more like:

{ 
  
 
  {
      let numCollected = 0;

      // (0) assemble filters
      const filters = [{
    field_id: 361086,
    field_type: 'SINGLE_USER',
    match_type: 'equal',
    values: [record_comment_or_reply_created_by_name].map((item) => ({ value: item })),
    type: 'contact',
  }];


      // (1a) retrieve records via the API
      const { data: { records, cursor } } = await tape.Record.getManyFiltered({ appId: 38446, limit: 500, filters: filters, }); 


      // (1b) keep track of num collected records
      numCollected += records.length;

      // (1c) update and push into collection variable
      record_collection_team_members.push(...records);

      
  // (2a) retrieve more records (page 2) via the API
  const { data: { records: recordsPageTwo } } = await tape.Record.getManyFiltered({ appId: 38446, limit: 500, cursor }); 


  // (2b) keep track of num collected records
  numCollected += recordsPageTwo.length;

  // (2c) update and push into collection variable
  record_collection_team_members.push(...recordsPageTwo);
  

      // emit success log event
      
    }

    
   
 }

so basically the filter values line from:

values: [].map((item) => ({ value: item })),

to

values: [record_comment_or_reply_created_by_name].map((item) => ({ value: item })),

I hope that makes sense :confused:

2 Likes

Many thanks for the report @Jason,

If you are fairly sure that we have an issue, then I can actually create a record for it in our issues app without double checking💯

Thanks again for identifying this bug in the automations. We will take care of it and get back to you here.

Best regards
Leo

2 Likes

Thanks for the detailed report @Jason - using your description we were able to reproduce the issue easily, and will provide a fix asap. Will let you know once the fix is live, it should be able to “catch the 8am train” tomorrow. :wink:

Cheers
Tim

1 Like

Great news - I can confirm this is now working :slight_smile:

Many thanks for the quick fix

1 Like