Skip to main content

Colleagues I'm attempting to create a custom symbol library with imbedded formulas.


In specific I am creating a property TaskID on each object then using the formula:


{{=UPSTREAM.TaskID + 1}}



I've tried variations.


The default value for TaskID in custom properties is 1.


However I am using the above formula to calculate the previous TaskID + 1 for the new TaskID. That way if I add a task between 1 and 2 it should recalculate.


In the above you can see that:



  • Start object TaskID is hard coded = 0

  • first task has formula and calculates 0 + 1 = 1

  • second task has formula and calculates 1 + 1 = 2  (not sure if this is calculated from result of the previous formula or from the default)

  • third task however seems to not take the calculated value but the default value from the previous


Please advise if this is a bug or another formula is better used for this.


Thank you

Hi John


Thank you for contributing to the Lucid Community. If I'm understanding your question correctly you will need to create a custom data field (e.g. "taskID") for each upstream shape. This custom data field will require the formula:


=(upstream."taskID")+1

 


As you noted the value of 0 will be input for the furthest upstream shape. Then you can reference the custom data field and display the value on the shape with:


{{=this."taskID"}}

 


It is important to note that each shape must be linked to the previous shape "in the stream" with a directional arrow. You can click + drag to confirm the arrows are truly attached to the shape.


I've included a screenshot below to visually demonstrate. I hope this helps and please let me know if you have any questions or concerns!


Please see below:


Hi John


Can you please verify whether you've created a custom data field for each shape titled "TaskID"? The input for this data field will need to be:


=(upstream."taskID")+1

 


You can manage custom shape data in the Data tab of the Contextual Panel on the right-hand side of the editor. Please see the Custom Data section from the Data Linking article in the Lucid Help Center for more details.

Below I've included a screenshot of what this will need to look like in your case. Please let me know if you have any further questions or concerns!


 



Please note:


Each object has a custom property: TaskID


Default value for TaskID on each object = 0


Jogged each object to assure they are connected



Thanks for following up. Can you please confirm whether you have input the formula below (without the curly brackets) to the "TaskID" data field?


=(upstream."taskID")+1

 


Richard please see screen shot in last post.


Formula for each task object is: 


{{=(upstream."taskID")+1}}

Hi John


This formula must also be entered for the "TaskID" custom data field as shown in the screenshot below. Please note that all formulas start with = and only require curly brackets (e.g. {{= ) when typing directly in the shape. For more information please see the Formulas article from the Lucidchart Help Center and the Lucid Formulas Resource from the Lucid Developer Portal and let me know if you have any further questions about the setup of this document or formulas in general!


 



Hi Richard thanks.


The formula IS entered for each TASK object as illustrated in my screenshot above.


The event object also has custom property TaskID but it is hard-coded to the value of 0.


The above is shown encapsulated with {{ }} as i was entering the formula directly into the shape. I do understand that {{}} is not required when using the editor.


Thanks


Hi John


Thanks for getting back to me my working example also has the "taskID" value hard-coded to 0 in the furthest upstream shape. With this formula: 


=(upstream."taskID")+1

 


the "taskID" data field should increase by +1 for each downstream shape. To display this value you can either input the formula directly into the text of the shape with curly brackets or you can input the formula within the custom data field and use "@" to reference the calculated "taskID" value as shown in the screenshot below.



If you're still having trouble please let me know and I will open a support ticket so we can take a closer look at your document. Thank you for your continued help and patience as we work through your questions together.


Reply