Can't Write Numbers from Excel to Text Parameter

I’ve been beating my head against the wall for a while now and am stumped. I’m trying to write parameters from Excel to my families. The parameter is a text parameter, the values in Excel are a mix of symbols (–) and numbers. So far I’ve tried a variety of cell formatting options in Excel, several different Set.Parameter nodes, String From Array, and String From Object. StringFromArray worked but the result wasn’t quite what I expected (or need) and String From Object converts everything but the numerical values end up as decimals; instead of 15, 16, 17 I get 15.000, 16.000, 17.000 etc.

Graph is nothing fancy. Dynamo is reading everything correctly, I just can’t get it to actually write numerals (symbols & text work fine)… Is there a trick to get something into a text parameter if it isn’t an alphabet character or symbol?

String from Object is the solution. You need to then use a string.replace node to swap the “.0000000” with “”.

1 Like

Thanks. :beers:

Ses this optionally:

If possible, the “Data.ImportExcel” should respect the cell formatting in Excel. Any cell value that is computed value in Excel is converted to Numbers automagically. I recommend we should let Excel maintain the cell formatting and and “data. ImportExcel” should respect the data type while importing. This would eliminate an extra step every time. @jacob.small Please see if you can make this happen.

A quick note: This node should be replaced with the open XML import excel node, as the new node is multiple orders of magnitude more stable.

It does appear that this is possible after reviewing this link: https://learn.microsoft.com/en-us/office/open-xml/how-to-retrieve-the-values-of-cells-in-a-spreadsheet

However it would need a good amount of testing - in particular in regards to formula results… in any case, best to submit a feature request via the Dynamo wish list here: GitHub - DynamoDS/DynamoWishlist: This is a repository for all wishlist items for Dynamo Core

Or to the roadmap here: Roadmap - Dynamo BIM