Visual Connector and task.IncludeAllfields
Forums
Hi Brian,
It's been quite a while since I've had a question and I hope all has been well with you and yours over the last couple of crazy years.
I'm currently working on a script and I have a question on using visual connector.
My script is joining several files to a primary file using visual connector and it's working.
However, I am using task.IncludeAllfields which is giving me a lot of unnecessary columns in my output file.
This makes everything quite slow when dealing with a file with hundreds of thousands of records.
My problem is that the structure of the "primary" file id0 may not always be constant.
This makes it impossible (at least for me) to hard code using task.AddFieldToInclude id1, "FIELDNAME" as I can't predict all the fieldnames in my primary field
However, the fields in each of the secondary files will always be the same so I can hardcode the specific fields I want from these files
I'm wondering is there a way to script visual connector to include all the fields in the primary file without specifiying them and just specify the secondary fields
As I said, the script does work at the moment but I'm pulling in fields I don't need from the secondary files and creating a larger output than I need.
Direct extraction in the next step would deal with that issue but I would prefer to speed up the "join" by reducing the fields
Thanks,
Phil
Hi Phil,
Hi Phil,
What you could do is place the names of the primary file in an array and use the array to populate your Visual Connector. The only problem might be if the connection fields are of different names in the primary file. Here is an example of using an array to get the field list of the primary file: