Solved

Error in Data Source Designer - Script Type

  • 20 December 2021
  • 3 replies
  • 91 views

Userlevel 6
Badge +26

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!

icon

Best answer by Atheeq Maharoof 22 December 2021, 16:18

View original

3 replies

Userlevel 5
Badge +12

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

Userlevel 6
Badge +26

@Atheeq Maharoof 

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

Cheers!

Userlevel 5
Badge +12

@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