What is wrong with this script?


#1

I have created a simple script to report View Dependency to a Text parameter but it failed to write. File is attached. Really appreciate if someone can point out what went wrong.

ReportViewDependency.dyn (6.0 KB)


#2

why did you use List.Creat ?
if you have to use it, use flatten after list create or make Value input in SetParameter node Level 2


#3

@ToanDN
You cant send that type to a string parameter (guess you have made a string parameter for ViewDependency)

ReportViewDependency.dyn (6.6 KB)

BUT Dont use the Clean node in that position… the list that feeds ‘Set Parameter’ is in princip not the same as the list after Cleaning! Remember to respect the data structure.

I will suggest this workflow, the error in the ‘Set Parameter’ is an read-only for views that cant be set. I dont know which types of views you need to set parameter for, so try to solve that part in your graph.

ReportViewDependency2.dyn (6.9 KB)


#4

Thank you very much!

The script is now working correctly despite the warning.


#5

@ToanDN,

You might succeed this time deleting elements in a collection and be lucky enough that the list you compare with has the same length. But it is not recommendable to do what you do. If you don’t respect data structures you will end up in trouble some day. Try to learn from this and do it right instead of pushing your luck!