Forum Discussion

vkandalam's avatar
vkandalam
New Contributor II
3 years ago
Solved

How to check The size of the response from Salesforce

Hi I am getting this as a response from Salesforce SOQL Query Snap I would like to check how many Ids we have in the response. In this instance I have to 2. And I want to perform a different action if the size is greater than 1

  • Hi @vkandalam,

    There is a function called: snap.in.totalCount.
    For each id, it will return a number starting from 0(you need to add + 1 at the end) all the way to the last id.
    the last id will contain the number of the total IDs. You can get the last id with the snap Tail.

    Or you can also get the number with the Aggregate snap.

    Regards,
    Viktor N.

1 Reply

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    Hey @eshanbhatt,

    I’ve also had some issues with JDBC snaps in the past, especially with the Select. As I remember my error was related to the tables, and switching to Execute snap with query, fixed the problem. You can give it a try.

    I hope this helps,
    Bojan

    • eshanbhatt's avatar
      eshanbhatt
      New Contributor

      Hi @bojanvelenski,

      Thanks for the quick response.

      I’ve tried the same steps with all JDBC snaps. My issue is within the Account Setup, where I’ve tried with different postgresql jars but the account validation itself is failing.

      The error is also not clear if there is an issue with my server or driver or some issue with snapLogic.