We'd love to hear from you! Provide  feedback  to earn a badge today. Take our quick survey
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

ROQL result set (multidimensional array) into single array

Received Response
19
Views
3
Comments
edited Dec 20, 2018 6:18AM in Integrations and APIs 3 comments

Content

Hi all.

I'm doing a ROQL query from a report custom script on a custom field containing an array. I'm trying do get all the results into 1 array so I can perform a count on the data.

Currently I use in the Finish tab the following code

$roql_result = RightNow\Connect\v1_3\ROQL::query( "SELECT Account.CustomFields.c.named_user from Account WHERE Account.CustomFields.c.named_user IS NOT NULL" )->next();

while($result =  $roql_result->next())
{
$new_array[] = $result['named_user'];
}

$exit_obj[0][0]->val = count($new_array);

This gives an output of 3 as I have 3 accounts with data, I woud like to count the data (output = 6)

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!