Manupulating Array value (List in Appsheet) using LOOP actions

Being inspired by @steve s LOOP actions tips and tricks, to add arbitrary number of childs records, I came up with ideas to manupilate values in array, which means list values in Appsheet.

User select and/or add values to Enumlist type fields then convert those values as we want. In this simplified sample app, we select and/or values to enumlist, which represents the name. Then we add the string (text) at the end of each listed values to generate the converted list values.
In other words, we, as app user, just create the list values, then appsheet actoins and formulas will add (append) the arbitrary values to the end to each listed items on enumlist value and manupulate another enumlist (or simply list).

We are able and achieve the same, just simply creating the VC, but there is limination with that approach. We need to place the constrain the number of max items on the enumlist. However, using @steve tricks for looping action,s we remove that constrain. We dont need to care the number of items on the enumlist with this triks as LOOPING actions will look after regardless of the number of the listed items.

Again in this simplied sample, we select and add the name which will construct the list of the name.

And on the another field, we push the @domain.com whatsoever. Then virtual column will return the proper email addreess as list, but the looping action will do the same.

For the tircks behind, please visit the sample app here.

https://www.appsheet.com/samples/Published-App?appGuidString=8b6c24bb-a96b-4b79-a40e-75e3bcce647b

For the tricks with virtual column, the expessions is hard-coded, so there is limitation in term of the number of the items in the enum list. But if we are able to envisage the max possible number for the items, this approach will work nicely. This is easiest approach.
But if we cant do so, this looping action will do all the stuffs without concerns.

On this demo app, I demonstrates the manupulation of array with string values. But it is easily converted to deal with the array (list) values which is numeric to manupulate. For instance, when we have list value with base type number, we can freely manupulate each standing items, add, substract, devide or even more complex calc. Simply change the base type of list to numeric, and do whatever calc you want.

Enjoy.

Appsheet capabiliy is unlimited as always.

@Steve
@Aleksi
@praveen
@MultiTech_Visions
@Suvrutt_Gurjar
@LeventK
@Fabian
@Kirk_Masden
@GreenFlux

For those who are “Coder”, yes, we can do .push() and .map() sort of operation and method in appsheet.

18 Likes

@Marc_Dillon
@Scott_Haaland
@Lynn
@Takuya_Miyai
@Rafael_ANEIC-PY
@Austin_Lambeth
@TyAlevizos
@TDhers

3 Likes

Oh man, at this rate i’m gonna end up doing my final year project for my civil engineering degree in appsheet ! array manipulation + looping opens so many posibilities, thanks for sharing this with us @tsuji_koichi, this one goes to my bookmarks.

4 Likes

Alternative to using a decrementing/incrementing “Count” variable, I also like to just take the first item from a List, then remove that first Item ([list] - INDEX([list],1)), then loop, with the looping action being dependent on if the List ISNOTBLANK()

9 Likes