String List

Hi,
lets suppose we have an excel, and specific field is a string like “A,B,C,D”.
I can convert it into an array using custom script, but as far as I know the result could only be used as a single result and not as a collection.

It will be great to use that result as a source to a asset grid for example. Is that possible?

thanks

Hi,

In order to use your result as data feed to a Collection in Intuiface, you will have to convert your:
"A, B, C, D" (which is the value of a single cell) into 4 rows, containing respectively "A", "B", "C" and "D".

Be careful with scripts/formulas supported in Excel Interface Asset, you can find a list here for Windows and here for tablet/kiosks.

Regards,

Alex.

1 Like

@Alex thanks for your reply.

I was asking about a way inside Intuiface after getting data from Excel.

Example of data structure in a excel sheet

NAME | COLORS
Shoe | “black, grey, white”

It will be great, if it was possible to split colors field by “,” in intuiface and return a result in a form that could be passed to an asset grid (like arrays on API REST)

Will be a way to have a “1 to many” relation in excel, in this case 1 product has N colors

I agree, that would be a nice idea, and I suggest you post it in our #wishlist category :wink:

In the meantime, because an Excel sheet is a 2D table by nature, you’d have to split these colors on multiple rows.
In these cases, we usually create a separate sheet that would assign N colors to 1 product.

1 Like

@seb yes you are right and my first approach, more clear way to structure data was like you said. But my problem always raise when I need to show multiple items with respective colors at same time.

Only option, using Excel, that I found was to have all in same sheet and by limiting number of colors and create N columns per color. Not a perfect solution, first is not an elegant way to structure data second it is limiting number of “colors” that an item could have.

Thanks

1 column per color is indeed the right solution to your use case, if you need these multiple colors displayed for multiple items, just using Excel.

The “ideal” solution, for a clean “data base”, would be to have a Custom Interface Asset that would parse the data base and the list of colors and would create the proper data feed with nested lists. Something like:

{ 
   "products":[ 
      { 
         "name":"product 1",
         "colors":[ 
            "blue",
            "white",
            "red"
         ]
      },
      { 
         "name":"product 2",
         "colors":[ 
            "brown",
            "green"
         ]
      }
   ]
}

Such a structure would enable you to have a collection representing the colors, nested in the collection of products. Excel can’t generate such a structure, but APIs & custom Interface assets (.NET or JS) can.

2 Likes

@Seb thanks again

I am trying to build a simple custom IA, can you share a simple JS custom IA where returns nested lists?

thanks

I don’t think I ever wrote one in JS. You can take an example in the Shopping List for simple lists, then use the IFD from .NET IA used the Dynamic Collection sample I shared with you.

2 Likes