LabVIEW Flatten to JSON Function Broken Wire

Updated Mar 24, 2022

Reported In

Software

  • LabVIEW
  • JSONtext

Issue Details

I am using the Flatten to JSON function with a cluster for the input terminal in LabVIEW. As a result, I am getting a broken wire saying polymorphic terminal can not accept this data type. Why do I get a broken wire and how can I fix it?
An example of an input cluster

Solution

The reason behind getting a broken wire is because JavaScript Object Notation (JSON) does not accept 2 or more objects with the same name (Unlike LabVIEW).Look for any data types with the same name. If there are any, you need to rename them. You can not have two identical named elements for a JSON file.

Below you can see a basic example of a cluster which will not work with Flatten to JSON function as it has two indicators with the same name.
Cluster with identical objects


In the example below, you can see that changing the name of one indicator makes the cluster acceptable for the function.
Cluster with different names

Additional Information

Aside from that, keep in mind that this terminal does not support data types, such as enums, refnums, file paths, and fixed-point numbers. This can also cause a broken wire.
For more information about acceptable data types, please refer by this link: Flatten to JSON function .