Skip to main content
Solved

Error in Data Source Designer - Script Type

  • Dec 20, 2021 7:21 AM UTC
  • 3 replies
  • 143 views

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

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!

Best answer by Atheeq Maharoof

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

View original

3 replies

Atheeq Maharoof
Superhero (Employee)
Forum|alt.badge.img+12
  • Superhero (Employee)
  • Answer
  • Dec 22, 2021 3:18 PM UTC

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


Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Author
  • Superhero (Employee)
  • Dec 22, 2021 11:13 PM UTC

@Atheeq Maharoof 

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

Cheers!


Atheeq Maharoof
Superhero (Employee)
Forum|alt.badge.img+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