Cycle through list and build compound array...

I have a database that I'm pulling data from that is already existing. There is a designs table and a details table. The designs table stores the id's of the details items that are associated with the design. Since I'm using Flash remoting I would like to just get all the designs and their details back in one compound array instead of making a bunch of calls. I'm stuck on how to make the string "5,8,12,19" into an array, cycle through the array and then get the details info for each id. Then return the compound array when finished.
I would prefer the array be like this:
[design item 1 and it's data][details array of the design 1 items], [design item 2 and it's data][details array of the design 2 items]....
Here is what I have so far
<cffunction name="getDesignsByAct" access="remote" returntype="query" hint="gets activities by id">
<cfargument name="send_id" type="numeric" required="yes" />
    <cfquery name="getDesignsByActQuery" datasource="#dsn#">
    SELECT design_id, design_items
    FROM designs_table
    WHERE design_activity = #send_id#
    </cfquery>
    <cfquery name="getDetailsQuery" datasource="#dsn#">
SELECT
    FROM
     details_table
    WHERE <!-- cycle through the list of "design_items" in the above query -->
</cfquery>
    <cfset this_return[1] = getDesignsByActQuery>
<cfset this_return[2] = getDetailsQuery>
   <cfreturn this_return >
</cffunction>
Thanks in advance.

Is your end goal to get a multi-dimensional array?  a query recordset object?  or an array of structs?  Based on your description, it looks like you want something like this:
arrMultiDimArray = NewArray(2)
arrMultiDimArray[1][1] = Query Data from Design Record 1
ArrMultiDimArray[1][2] = Array of Detail records data structures (or query recordset object?) associated with design record 1
If that is the case, then you should be able to put something together like this:
1) Query your design & details data from the database as a joined recordset
2) Initialize your multi dimensional array
3) You can use the <cfoutput group=""> attribute to create an outer loop that only changes once for each new design ID
4) Increment your first dimension array and add your design data to position one of your 2nd dimension
5) Create a new array to store your Detail record items
6) Use a nested <cfoutput> loop to loop over your detail item records and populate your new array
7) Store your new array in position two of your 2nd dimension
8) Return your 2D array to your flash remoting app

Similar Messages

  • Pages cycles through documents and won't open any of them - what do I do?

    Pages cycles through documents and won't open any of them - what do I do?

    Thanks for replying -
    my operating system is OS X Lion 10.7.5
    Pages version 4.3
    What I mean by 'cycles through documents" is that when I attempt to either open a document or just open the application - it looks like the application begins to start - I see the first page of a bunch of documents very quickly going from left to right on my screen but then I see a bar in the middle of the screen (I'm not sure what its called but its the one that tells you to wait while the computer does something) - and then it just stays there, never opening the documents.
    My version of pages has always had the "cycling" effect at the beginning but it always ended quickly and I could begin working on my documents - now.... I can't begin working on anything and the only option I have is to force quit.
    Thanks for any advice you can give me!

  • Pod Classic 6th Gen cycling through connecting and disconnecting

    Further to a previous post regarding this problem, I too have today had this happen.
    Tried to sync my iPod, cycled through the connect/disconnect, updated iTunes repaired permissions (just in case) trashed plist file (any port in a storm) restarted my iMac then tried putting my iPod into disc mode, the same thing happens, connect followed by an almost instant okay to disconnect.
    Not sure now how to proceed as up until now my iPod has been faultless after around 3 years of everyday use. I have a whole raft of books I need to sync, my iPod being used mainly for books.
    Anyone help with this, I have had no previous problems with my iPod I have therefore had to do little in the way of diagnostics. So I'm pretty much stuck. Oh I have tried another cable and a different USB port.

    I had not tried connecting my iPod directly to my iMac, this worked okay in disc mode and I have managed to sync my iPod.
    For some reason after three or so years the sync that I normally undertake via my powered USB hub will now not work? Sync does work when plugged into one of my iMac's USB ports (I have tested both hub/Imac a number of times in the past two hours).
    Is it possible that I have a USB hub problem, the hub supports two other items, these are both working normally. Undertaking a sync via the back of my iMac is inconvenient, I would like to use my USB hub, any ideas from anyone on this?
    Thanks

  • Iterate through List and return (the names) of all the classes

    Hi,
    I've got a List and want to see what kind of classes are in this List.
    List list = getList();
    Iterator it = list.iterator();
    while (it.hasNext()) {
         Object ob = it.next(); // get the next item. Is this the right approach for my problem?
            // Her I want to check the Object what classses it holds,
            // assuming that this is the right approach for my problem
    }Thanks
    Jonny

    Hi,
    that's what I did:
    List list = getList();
    Iterator it = list.iterator();
    while (it.hasNext()) {
         Object ob = it.next(); // get the next item. Is this the right approach for my problem?
             Class cLass = ob.getClass();
             System.out.println("\t" + cLass.getName());
    }This returned java.lang.Object as mentioned.
    Question:
    - Can an Object hold several types of classes? If so, how can I iterate them?
    Mabe this makes things a little clearer:
    Why am asking this? I'm returning a List from a (Hibernate)-query. I can access one Class without problems. Another class that should be returned, I can't access. Thats why I want to know what I'm dealing with.
    Thanks
    Jonny

  • Yahoo mail keeps cycling through login and will not open.

    I was trying to get a picture of a plane off of the yahoo emails I was sending out. I must have done something to the security settings. I can open my yahoo, but when I click on a piece of mail I can't get into it. The http:// site cycles endlessly and won't stop. I don't know what to do.

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"

  • 3GS crashed during OS6 upgrade and now cycles through 'off' and apple screens

    I succumbed to the OS 6 upgrade, but mid-upgrade the phone appeared to have crashed. After no progress after 20 minutes I rebooted, and boy do I regret this move. The phone now cycles from off, to apple screen, to off, to apple screen, and I do not know what to do to stop it. Can anyone out there help me?

    Problem solved. I used the natural on/off cycling to restore to factory and backup from computer (pressing home key and connecting to computer).

  • I thought there used to be a way to cycle through bookmarks and delete all those that have died, but I can not find it; ?

    Simply that I remember years ago that I had an option which would try to open each bookmark and delete all the dead ones.
    I would like it back.

    The [https://addons.mozilla.org/en-US/firefox/addon/checkplaces/ CheckPlaces] add-on might help.

  • How do you retrieve child tags from a parent tag in a tree structure and build an array from it?

    Is there a property node somewhere that can retrieve the tags of all the children of an "active" parent tag in a tree structure? If I click on the parent tag, I want to be able to show what child tags are under that parent tag.

    There is not a property or method that I have been able to find, however I wrote this VI that given a parent tag returns all the children.
    Evan Collier
    Attachments:
    Get_1_Lv_of_children.vi ‏59 KB

  • Need to seperate data aray into samples of 100 at a time to run through kurtosis and plot

    Hello,
    I am trying to build a vi that will take in a file and build an array (this part done) from it. from the array, I need to take samples of 100 and run kurtosis on and build an array of results for entire data set and possibly plot kurtosis values. any ideas? I have attached what i have so far. I keep getting errors for the kurtosis VI, not sure what the problem is.
    Thanks,
    Attachments:
    TqKurtosis Test Version.vi ‏15 KB

    Your program does not make a lot of sense. Why use a while loop that chops through your data in nanoseconds (=way before you have a chance to press the stop button!) and runs out of data equally quickly, leaving you nothing at the output tunnel. Why is your kurtosis indicator EXT datatype???
    The number of segments is exactly known, so the loop must stop after a known number of iterations. Since the number of iterations is size/100 (possibly rounded up), you need a FOR loop, or even easier, reshape the 1D array to a 2D array where each row is size 100 (see attached).
    Now simply loop through your segments and built an array of results at the output tunnel.
    Here's a quick draft example (LV 9.0), modify as needed. Since you did not include the subVIs, I skipped them and faked some data instead. I added some extra graphs for troubleshooting. Delete them once you are happy with the code.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    TqKurtosis Test VersionMOD.vi ‏21 KB

  • Cycle through XML on click/swipe

    I'm (still) working on my xml phone book. I need to cycle through the data in the array on mouse click. (The mouse click will be a swipe on a mobile device.)
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var imageNum:Number=0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void {
          var theXMLData:XML = new XML(XMLURLLoader.data);
          totalImages=theXMLData.name.length();
          for (var i:Number =0; i < totalImages; i++){
                //push xml data into the arrays
                nameArray.push(theXMLData.name[i]);
                countryArray.push(theXMLData.country[i]);
                portraitArray.push(theXMLData.portrait[i]);
                flagArray.push(theXMLData.flag[i]);
                jobtitleArray.push(theXMLData.jobtitle[i]);
          //data is processed
          loadData();
    function loadData():void {
          var thisPortrait:String = portraitArray[imageNum];
          var thisCountry:String = countryArray[imageNum];
          var thisName:String = nameArray[imageNum];
          var thisJobtitle:String = jobtitleArray[imageNum];
          var thisFlag:String = flagArray[imageNum];
          var dataLoader:Loader = new Loader();
          dataLoader.load(new URLRequest(portraitArray[imageNum]));
          dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
          function dataLoaded(event:Event):void {
                stage.addEventListener(MouseEvent.CLICK, loadMainImage1);
                function loadMainImage1(event:MouseEvent):void {
                      portraitUILoader.source=thisPortrait;
                      flagUILoader.source=thisFlag;
                      selectedName.text=thisName;
                      selectedCountry.text=thisCountry;
                      selectedJobtitle.text=thisJobtitle;
    //add 1 to imageNum
    if (imageNum < totalImages) {
         trace("imageNum " + imageNum);
         trace("image name (thisPortrait) " + thisPortrait);
         imageNum++;
         if (imageNum!=totalImages) {
              loadData();

    solution :
    import flash.events.MouseEvent;
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var contactArray:Array = new Array();
    var imageNum:Number = 0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void
        var theXMLData:XML = new XML(XMLURLLoader.data);
        totalImages = theXMLData.name.length();
        for (var i:Number =0; i < totalImages; i++)
            //push xml data into the arrays
            nameArray.push(theXMLData.name[i]);
            countryArray.push(theXMLData.country[i]);
            portraitArray.push(theXMLData.portrait[i]);
            flagArray.push(theXMLData.flag[i]);
            jobtitleArray.push(theXMLData.jobtitle[i]);
            contactArray.push(theXMLData.contactInfo[i]);
        //data is processed;
        loadData();
    homeScreen_btn.visible=false;
    var thisPortrait:String;
    var thisCountry:String;
    var thisName:String;
    var thisJobtitle:String;
    var thisFlag:String;
    var thisContact:String;
    function loadData():void
         thisPortrait= portraitArray[imageNum];
        thisCountry= countryArray[imageNum];
        thisName = nameArray[imageNum];
        thisJobtitle = jobtitleArray[imageNum];
        thisFlag = flagArray[imageNum];
        thisContact = contactArray[imageNum];
        var dataLoader:Loader = new Loader();
        dataLoader.load(new URLRequest(portraitArray[imageNum]));
        dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
        function dataLoaded(event:Event):void
                portraitUILoader.source = thisPortrait;
                flagUILoader.source = thisFlag;
                selectedName.text = thisName;
                selectedCountry.text = thisCountry;
                selectedJobtitle.text = thisJobtitle;
                selectedContact.text = thisContact;
                //add 1 to imageNum and cycle through the data
                if (imageNum < totalImages)
                    imageNum++;
                    trace(totalImages);
                    if (imageNum!=totalImages)
                        goNext_btn.addEventListener(MouseEvent.CLICK,nextfn);
                    }else goNext_btn.removeEventListener(MouseEvent.CLICK,nextfn);
                }//closes incrementation loop
            }//close loadMainImage
    }//close loadData
            function nextfn(e:MouseEvent):void{
                loadData();

  • Best Way To Build An Array Of Many Elements

    Simple question for you LabVIEW experts: I want to build an array of many element for use in my code.  The problem is I have 20 elements I need to insert into the "Build Array Function."  This takes up much code space and is really not that clean.  I was thinking of using a For Loop and use the iteration terminal as the index for each element.  The For Loop would then use auto indexing and build this array for me.
    Is there a more efficient way to do this?  Thanks!

    hobby1 wrote:
    Crossrulz, I was planning on handling it like this: 
    I have a total of 17 element I need to build an array from.  Each case would include another element to be written to the array.  Is this the correct way to handle this?
    Thats one way to do it.  Not nearly as efficient as using the Build Array, but it will work.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to Extract the Freq List, Cycles per Freq and Samples per Cycles of sweep waveform

    How to Extract the Freq List, Cycles per Freq and Samples per Cycles of sweep waveform
    I want to extract the freqency distribution, cycles per freqency, and samples per cylce of swept waveform, in order to output the same of swept waveform with I have acquired by NI DAQ card, tks!
    owen wan
    Attachments:
    Untitled 1.vi ‏2333 KB

    Look inside the palette called Signal Processing - Waveform measurements.  There are a lot of functions here that you can use to get the information you desire.  For instance, the Extract Tones function will output an array of clusters, with each cluster element giving the frequency, amplitude, and phase of the signal component.  Go through the entire arry to see each frequency component of the complex waveform.
    Also, in the Waveforms palette there is the Get Waveform Components function that will give you t0, dt, and Y components of the waveform.  1/dt should give you the sample rate.  See attached VI.
    - tbob
    Inventor of the WORM Global
    Attachments:
    WfmInfo.vi ‏4658 KB

  • How to Loop through another list and update a column with SharePoint Designer 2013 Workflow

    Hi,
    I am trying to get my head around the new 2013 Workflow Engine and SharePoint Designer 2013 Workflow Text-Based Designer.
    I have two lists.
    List A has 2 columns: Title, Completed (Yes/No)
    List B has 3 columns: Title, LookupListATitle, Completed (Yes/No)
    All the 2013 Workflow components have been installed and configured and I am selecting the 2013 Workflow option in SPD
    I am trying to set off a 2013 Workflow when an item in List A is edited to Loop through List B and select items where the LookupListATitle column's value is equal to the Title value of the current item, and set the value of the Completed column for those
    items in ListB to "Yes".
    I have the Workflow configured like this:
    Stage: Stage 1
    IF Current Item:Completed equals Yes
    Loop: 1
    The contents of this loop will run repeatedly while: ListB:LookupListATitle equals Current Item: Title
    Update item in ListB. 
    (The dialog options for the update item action as follows:
    List: ListB
    Field: Completed, Value: Yes
    In the Find the List Item section
    Field: LookupListATitle
    Value: Current Item: Title)
    Transition to stage
    Go to End of Workflow
    When I update an item in ListA and set its Completed column to Yes, I would expect the Workflow to find all the items in List B where the Lookup column is equal to ListA's Title (there are 2) and update their Completed column to Yes. But it doesn't work.
    When I look at the Workflow Status it says the Internal Status is "Canceled" and the information pop up has the following alien language (and may be truncated):
    RequestorId: 95f03b62-8956-ac14-c5cf-dc98c89c589c. Details: System.ArgumentException: Invalid JSON primitive: Item001. Parameter name: value at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.ConvertStringToJsonNumber(String value) at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.ReadPrimitive(String
    type, XmlDictionaryReader jsonReader) at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.JXMLToJsonValue(XmlDictionaryReader jsonReader) at Microsoft.Workflow.Common.Json.JXmlToJsonValueConverter.JXMLToJsonValue(Stream jsonStream, Byte[] jsonBytes)
    at Microsoft.Activities.DynamicValue.ParseJson(String json) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
    executor, BookmarkManager bookmarkManager, Location resultLocation)
    Unfortunately I don't have access to the server, logs etc.
    I would love to find some tutorials, or any books on SharePoint Designer 2013 in general and Workflows in particular but my searches haven't turned up much so far apart from a pre-release Beginning SharePoint Workflows which is in its very early stages and
    not much help yet.
    Can anyone give me some guidance on how to set up While Loops to iterate through a related list using SharePoint Designer 2013?
    Mark

    Hi,
    I understand that you wanted to update the items in the other list (Participants) where the Course equals the Current Item.
    You need to use “Call HTTP Web Service" action and “Build Dictionary" action to get the Maxid and then loop Participants to update the items.
    You can follow the steps as below to achieve what you want:
    Create a custom list named Courses, add columns: Title(Single line of text), Course ID(Single line of text), Course Finalised (Yes/No).
    Create a custom list named Participants, add columns: Title(Single line of text), Course(Lookup), CourseFinalised (Yes/No).
    Create workflow associated to Courses, start the workflow automatically when an item is created or changed.
    Add conditions and actions:
    The HTTP URL is set to
    https://sitename/_api/web/lists/GetByTitle('listname')/items?$orderby=Id%20desc and the HTTP method is set to “GET”. Then the list will be order by Id and desc.
    Then if Course Finalised is equal to Yes, the CourseFinalised  of the associated items in Participants will be updated to Yes.
    More information:
    http://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Programmat​ically Cycle through Boolean Array

    I'm using an Agilent 34970 with a 34901A switch module. It has 16 switches going to two commons. The end function is to switch through all the sources to read resistance and voltage.
    The driver and sample vi from the NI idnet were used as a base for my vi.
    The sample vi uses a user-controlled 2-d boolean array (false = open). I want to be able to programmatically cycle through all the switches, but I don't know how to tell the dimensions of array I have.
    I would like to go through every element of the 2nd raw for each element in the 1st row. If I could programmatically ignore elements #9, 10, 19, and 20, that would be helpful too.
    Thanks for any help!
    Attachments:
    Agilent 34970 Advanced Scan-2U test-1.vi ‏31 KB
    Agilent 34970 Switch-2U test.vi ‏23 KB

    CelerityEDS wrote:
    Is there a way to determine what's in the vi front panel right now? I cannot determine if it's 2x10 or 10x2... There are no properties of the 2-d array that plainly tell me.
    There is "array size" which tells you the actual size of the 2D array.
    There are properties that tell you how many rows and columns are visible in the front panel array container.
    There are also properties that tell which element is currently scrolled to the top left corner.
    The size and index position of the front panel array control or indicator is not related to the actual array size. You can show only 2x2 elements of a 1000x1000 array or vice versa. if the container is too big, the extra elements are greyed. 
    LabVIEW Champion . Do more with less code and in less time .

  • How to change keyboard shortcut for cycle through open tabs in PS and AI CC 2014

    I would love to set my own keyboard shortcuts for cycling through open tabs in PS and AI 2014 on OS X. I found out that this can be achieved with ctrl+tab in PS, but I couldn't manage to make any of the suggestions in the forum work for AI. As said, I would like to set a more "standard" shortcut like alt+cmd+arrow-keys for both of the apps. If that shouldn't be possible, does anyone know a shortcut in AI CC 2014?
    Many thanks!
    Amadeus

    Thanks! The shortcut can be set like this in AI, although all key combinations I would want to use are not allowed. Too bad. But anyways, thank you very much for the tip!
    cmd+~ is not an option for me, I guess, since the swiss/german keyboard layout has no dedicated tilde key.
    So, I have a working shortcut in PS (ctrl+tab / of which I still don't know how to change, if possible at all) and thanks to you, I can now set one in AI as well. Unfortunately, I can not set it to be identical as in PS, since the "cmd" key needs to be included in AI's shortcut assignment dialogue, but I guess, this is as good as it gets.

Maybe you are looking for

  • Filters unresponsive in PS CS4 (mac / snow leopard )

    After making sure layer needing adjustment is highlighted i do the following: ' FILTER' >NOISE>REDUCE NOISE> MOVE sliders with preview selected TO 'REDUCE COLOR NOISE' or 'PRESERVE SHARPNESS' and I get NOTHING...NO APPARENT CHANGE. What am I doing wr

  • When I burn to DVD 1 of 3 Audio Tracks is missing

    I use Premier Elements,  New to this application as well as the process. We are making a movie of still shot pictures with back ground music.  There are 3 songs that play.  The 1rst and 3rd play as well as the menu music.  However the 2nd song doesn'

  • Hp mini 110 bios password

    Eugene try. e9l113qpin Third letter is lower case L. Just a note - if you participate in this thread I must inform you that these services are not endorsed by HP, and that HP is not responsible for any damage that may arise to your system by using th

  • Why won't firefox release when I X out of page?

    When I finish with a website and X out of it......then try to get back into my start page through mozilla firefox....I get a message stating that I am still in firefox....it won't let me out until I wait about two minutes....I have read other blogs w

  • ITunes file was received damaged

    A file I purchased on ITunes was damaged. Sound breaks up for ~1/4 second at 1:24 into the track. How do I get a replacement?