dsroelofsen Posted August 4, 2016 Share Posted August 4, 2016 Hi guys, I am trying to read origins and destinations out of an Excel file. To do this, I defined a process, in which I read the Excel file using "Excel Read", in which I read the origins and destinations and write them in the Node Reference State Variables ExcelOrigin and ExcelDestination respectively. After this, I created an entity, for which I assigned the Node Reference State Variables "ModelEntity.Origin" and "ModelEntity.Destination" to the previously defined "ExcelOrigin" and "ExcelDestination". Then I want to transfer the entity from Free Space to ModelEntity.Origin and set the destination using SetNode to ModelEntity.Destination. However, upon running the model, it states that "The value 'ModelEntity.Origin' for property 'Transfer.NodeName' is a null or undefined reference". It seems that it does not read the nodes properly from the Excel file, but if I change the input in the Excel file to a random number instead of one of the nodes, it presents the error of a data error mismatch; this makes me think that it does read the Excel file and sees whether or not the input are nodes. Is reading Nodes into a Node Reference State Variable from Excel even possible? Anyone who came across the same problem or has a solution? I have included my example in the attachment. Excel Read Node Reference State variable.spfx Input.xlsx Link to comment Share on other sites More sharing options...
KatieP Posted August 15, 2016 Share Posted August 15, 2016 ExcelRead only reads String and Numeric values. These string values cannot be applied to an object type state. However, you can bind your Excel file to our Tables and import your data in that way. Attached is model that demonstrates this. First, bind the Excel file to a Data table: Create a data Table (no columns), Bind to Excel file, Change Column Type to Object>Node, and Import data. Check out Help Topic Importing and Binding To Tables for more info on binding. Import can be set to Automatic (default) or Manual. Then modify your process logic to use a SetRow step instead of ExcelRead, start ExcelRow as '1', and set the Transfer and SetNode to reference the table. TableBind Node Reference State variable.spfx Link to comment Share on other sites More sharing options...
Recommended Posts