Load a Formula into a single Shared Parameter

Hi all, I have a list of shared parameters in an Excel file, and am able to successfully apply them to an open family (even if I get an error). When I try to add a formula to one of those parameters, I run into problems. So, my question is two-fold.

  1. What am I entering wrong in the //Values/ section of the code block that’s making it red? My function is an “if” function that works perfectly when entered manually into the parameter. The formula is: if(InKosten, “IN KOSTEN”," ")

  2. What in my script is missing or stopping any formula from showing up? When I try the “this is a test” value, I still get an empty formula field.

Any ideas? I’m very new to Dynamo and any help would be greatly appreciated.

AI_SharedParameters_withFormula.dyn (28.9 KB)

Shared Parameters.xlsx (8.8 KB)

I would suggest you use the “String” node instead of a code block for your input. Add a note to the top if you really need some description as the follows.

It fails because quote marks in a code block indicate text though you have quotes in formula as well.

2 Likes

Thanks! That helps for the text bit, but I still don’t get a formula. Any ideas there? The error I get is “Warning: Formula.Set operation failed.
It is an invalid formula string.
Parameter name: formula”

Found the issue in an old post. All is working now!