Skip to main content

Error in lucidscale functions processing single-value attribute arrays

  • May 24, 2023
  • 2 replies
  • 20 views

Steve S103
Forum|alt.badge.img+1

I have defined a Conditional Formatting rule for a display of some Azure Subnet objects which uses the addressSpace.addressPrefixes attribute.  This attribute is an array of strings holding the VNet addresses e.g.:

addressSpace:
  addressPrefixes:
    - "10.0.0.0/8"
    - "172.16.1.0/24"

I then access this attribute for the Custom Hover Text thus:

=CONCATENATE('Space:' @"addressSpace"."addressPrefixes"[1])

In the above example this correctly results in hover text of "Space: 10.0.0.0/8" (also showing that your arrays are indexed from 1)

HOWEVER if the addressPrefixes array holds only one item I instead get "#ERROR". 

It appears that the processing is unable to handle indexing an attribute with a single-valued array and in all cases where this array has only one value I get the error.  Others with multiple values resolve correctly.  Changing the index to [0] does not work.

This appears to me to be a bug in the processing.

 

Comments

Leianne C
Forum|alt.badge.img+15
  • Lucid support team
  • May 26, 2023

Hi @steve s103 thank you for posting in the community! Since we may need to take a closer look at your model to help troubleshoot the issue you are experiencing I am going to move our conversation to a private support ticket. Please keep an eye out for an email from Lucid support! 


Leianne C
Forum|alt.badge.img+15
  • Lucid support team
  • June 13, 2023

Hi there! Just updating this thread with some additional information to help anyone else who may be seeing a similar issue. Our engineers confirmed that this is currently working as expected however they provided the following information which may be helpful:
 
They recommended to use the ASARRAY function which will make an array if the item isn't (i.e. ASARRAY(1) => [1] and ASARRAY([1]) => [1]). If the SPLIT is wrapped in an ASARRAY it should work generically (i.e. ASARRAY(SPLIT(@"addressSpace"."addressPrefixes"[1] "."))[1]). 

Please don't hesitate to let us know if you have any additional questions about this. Hope this helps!