Skip to main content

Hello Community,

I have a data source designer script that returns an error when pressing preview button.

System.Collections.Generic.List`1[System.Collections.Generic.Dictionary`2[System.String,System.Object]]

Script is

var numberOverdueTasks21 = getDBValues('C_FSM_TASKS_OVERDUE_21_DAYS_SQL');
return numberOverdueTasks21;

SQL Script is

SELECT TASK_ID, PERSON_ID, STATUS, PLAN_START_DTTM FROM TASK
WHERE PLAN_START_DTTM > GETDATE() - 21
AND STATUS NOT IN ('CO', 'CA', 'CL');

Any ideas?

Cheers!

Hi @Shneor ,

As per my knowledge, it is not an error but it shows what type of object stored in the returning variable. Try changing the return line as return 10; instead of return numberOverdueTasks21; then you will see value 10 in the preview mode.

In order to achieve your objective, you can use a SQL data source. Following is an example. 

 

Data Source - SQL



Hope this answer helps.

Best Regards,
Atheeq


@Atheeq Maharoof 

My understanding is that a Script data source cannot return an array/multiple values? Only one?

Cheers!


@Shneor 

I am not sure whether  there is any other mechanism to achieve to return array/multiple values. According to this method, we cannot return multiple/Array values.

 

Best Regards,
Atheeq


Reply