accessing multiple references
I'm confused on how to access multiple items in an array. I have an app (A) that is referenced by multiple app (B). In App A, I would like to selectively display one or two text fields from app B for several of the most recent instances.
So for example, if in a calculation field in A I have
var textarray = @All of text field in B;
My understanding is that textarray is an array of all the "text field" text fields in B.
But if I want to go through a for loop and display each one of these text fields individually:
for (var i = 0; i < textarray.length; i++) { textarray[i] } // where the intent is to display textarray[i].
But I cannot seem to display the text from just the "i" element. Thanks!
-
Hi Martin,
it can display. And you don't need a loop for that. You can get it as a string by adding .join() . Inbetween the brackets you can define a separator like "\n" for linebreaks between the elements:
var textarray = @All of text field in B.join("\n")
Instead of "\n" you can set any other separator like " " or "; "
Rainer
Please sign in to leave a comment.
Comments
1 comment