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

  • viktor_n's avatar
    viktor_n
    Contributor II

    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.