Create LIST from CFLOOP

Hi all: I'm trying to create a list of 'ages' using CFLOOP
with user input from 2 form fields - FirstAge & LastAge,
filling in the ranges in between. Here is the relevant code:
<cfloop index="i" from="#FirstAge#" to="#LastAge#"
step="1"> <!--- user inputs FirstAge & LastAge --->
<cfset age = #i#>
</cfloop>
<cfset ageList = ValueList(age)><!--- This should be
a comma separated list from FirstAge to LastAge --->
Any thoughts on how to accomplish this?

Build the list inside the loop, one age at a time. Something
like the code below should work.

Similar Messages

  • Creating list from a matrix using pig

    I am new to Pig. Could somebody point me how this can be done ?
    I have a text file containing adjacency matrix:
    * x1 x2 x3 x4 x5
    x1 0 1 0 1 1
    x2 0 0 0 1 0
    x3 0 0 0 0 1
    x4 0 0 0 0 0
    x5 0 1 0 0 0
    I want to create adjacency list from this matrix which should look like this
        x1 x2
        x1 x4
        x1 x5
        x2 x4
        x3 x5
        x5 x2  
    so After I read matrix from the file : A = LOAD 'matrix.txt' USING PigStorage('\t') AS(x, x1, x2, x3, x4, x5); so DUMP A is now 
        (*,x1,x2,x3,x4,x5) 
        (x1,0,1,0,1,1) 
        (x2,0,0,0,1,0)
        (x3,0,0,0,0,1)
        (x4,0,0,0,0,0)
        (x5,0,1,0,0,0)
    Now I want to create group that maps each x1, x2,x3,x4,x5 of the first column to other columns that have at least one 1 
    Any help appreciated ! 

    Hi Smith_john,
    This one was tricky. Here what I have done to achieve the outcome.
     I remove column name from the dataset. The reason is I will provide column name from pig script.
                    x1 0 1 0 1 1
                    x2 0 0 0 1 0
                    x3 0 0 0 0 1
                    x4 0 0 0 0 0
                    x5 0 1 0 0 0
       2.   On pig grunt shell write below query to load data
           A
    =
    LOAD'/user/pigdata/pigmatrix.txt'
    AS
    (x,x1,x2,x3,x4,x5);
       3.   Replacing with column name where it found 1.
          X
    =
    FOREACH
    A
    GENERATE
    x,
    (x1==1?'x1':''),
    (x2==1?'x2':''),(x3==1?'x3':''), (x4==1?'x4':''), (x5==1?'x5':'')
       4.   Keeping first column as it is, Rest column converted into a bag. Flattening it to make rows
          row_f
    =
    foreach
    X
    generate
    $0
    as
    id,
    FLATTEN(TOBAG($1,$2,$3,$4,$5))
    as
    col2value;
        5.   Filter in record where there is value in second column
    frec =
    FILTER
    row_f
    by
    (col2value
    !=
        6.   Dump records (will print result mentioned in above screen)
                DUMP
    frec;
    Hope it helps. Please mark it answered if it answer your question.
    Thank you for choosing Microsoft HDInsight Service.
    Thanks and Regards,
    Sudhir Rawat

  • Creating List w/ CFLOOP

    Here's a simple form. I want to pass the value of "url" to a
    list. And if the value of the "url" exists to give the option to
    delete it. So, everytime submit is hit, I want the value of url to
    get compiled in a list :
    <cfif IsDefined("submit")>
    del #url#
    del #url#
    </cfif>
    <form action="test.cfm">
    <input type="text" name="url" size="60">
    <input type="submit">
    I should be able to put the value of "url" in a cfloop
    somehow, but can't quite have my finger on it.
    Any help would be greatly appreciated.

    How are you saving the list of URLs in the first place? If
    you are using sessions you would just modify jdeline's code to
    something like the attached code (sample 1). If you are storing the
    list in a database, you would need to query for the list, then
    check/modify it, and then write the new list back to the database
    for each page submit (no example code).
    If the user can input multiple URLs with each form submit,
    then you would have to know the delimeter being used and just loop
    thru them (sample 2).

  • How can I install list from English template in German SharePoint?

    I have a list, that was customized with InfoPath. I exported it as template and wanted to create list from this template in another server.
    The original list was created in SharePoint with English language. Now, the target server is in German language. My English list templates are not available in "Apps you can add".
    How can I create the list in German server? InfoPath won't deploy list to another URL, and recreating list in InfoPath would be possible but mean enormous amount of work.

    On which OOTB list is based your customized List you customized?
    Some more hints:
    1. Make sure that your target site is based on same site template as the site on which you created your template
    2. In some cases "Team Collaboration Lists" feature has to be enabled on target site, check if it is enabled.
    3. Compare other Site Collection and Site features on both Source and Target sites.
    Dragan Panjkov [http://www.dragan-panjkov.com]

  • Error creating document from using list using Document Template

    Hi All,
    I am trying to create a document from sharepoint list and upload it to a document library using item added and item updated event receiver methods. I can create metadata from list update in document library but unable to open the document. The error message
    I get is "we're sorry. we can't open "Filename" because we found a problem with its contents. no error detail available". Please see the below code.
    SPSecurity.RunWithElevatedPrivileges(delegate()
                       try
                           string TemplateUrl = string.Empty;
                           SPWeb web = properties.OpenWeb();
                           web.AllowUnsafeUpdates = true;
                           SPDocumentLibrary olist = web.Lists["NewLibList"] as SPDocumentLibrary;
                           String url = olist.RootFolder.ServerRelativeUrl.ToString();
                           SPFile file = null;
                           file = web.GetFile(olist.DocumentTemplateUrl);
                           if (file != null)
                               SPListItem oItems = properties.ListItem;
                               web.AllowUnsafeUpdates = true;
                               byte[] readStream = file.OpenBinary();
                               SPFile uploadedFile = olist.RootFolder.Files.Add("http://site/subsite/Libraryname/" + properties.ListItemId.ToString() + ".docx", readStream,
    true);
                               SPListItem listitem = uploadedFile.Item;
                               listitem["Firstname"] = oItems["Firstname"];
                               listitem["Lastname"] = oItems["Lastname"];
                               if (uploadedFile.CheckOutType != SPFile.SPCheckOutType.None)
                                   uploadedFile.CheckIn(string.Empty);
                               listitem.Update();
                               uploadedFile.Update();
                               web.AllowUnsafeUpdates = false;
                       catch (Exception ex)
                           EventLog.WriteEntry(EventLogName, ex.Message, EventLogEntryType.Error);

    Hi,
    Please try to use the code below:
    SPSecurity.RunWithElevatedPrivileges(delegate()
    try
    string TemplateUrl = string.Empty;
    SPWeb web = properties.OpenWeb();
    web.AllowUnsafeUpdates = true;
    SPDocumentLibrary olist = web.Lists["NewLibList"] as SPDocumentLibrary;
    String url = olist.RootFolder.ServerRelativeUrl.ToString();
    SPFile file = null;
    file = web.GetFile(olist.DocumentTemplateUrl);
    if (file != null)
    SPListItem oItems = properties.ListItem;
    web.AllowUnsafeUpdates = true;
    Stream readStream = file.OpenBinaryStream(); //file is SPFile type
    SPFile uploadedFile = olist.RootFolder.Files.Add("http://site/subsite/Libraryname/" + properties.ListItemId.ToString() + ".docx", readStream, true);
    uploadedFile.CheckOut();
    SPListItem listitem = uploadedFile.Item;
    listitem["Firstname"] = oItems["Firstname"];
    listitem["Lastname"] = oItems["Lastname"];
    listitem.Update();
    uploadedFile.Update();
    uploadedFile.CheckIn(string.Empty);
    web.AllowUnsafeUpdates = false;
    catch (Exception ex)
    EventLog.WriteEntry(EventLogName, ex.Message, EventLogEntryType.Error);
    If the issue still exists, I suggest you dubug your code and check whether line of code error.
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Is there an easy way of creating a distribution list from an email with multiple addresses? Those addresses are not in your contacts already, and don't need to be.

    I want to be able to take all the email addresses someone else has used to distribute an email and create the same distribution list for myself for future use.  I don't want to add all those people to anywhere in my contacts list.  I just want them to be in my "new distribution list", like "soccer families", etc.  I tried to copy and paste, but didn't get anywhere. Maybe I was close, or maybe it isn't possible.  Thoughts?

    Ed on iPad wrote:
    I don't want them in contacts because they are simply a related group (like my sons current soccer team).  People I may never need to email again after a sports season.  I don't want to have to have these people in my contacts permanently. 
    You don't. When the season is over, delete them.
    But, the text clipping should work.
    The next IOS should have a feature "create mailing list from distribution list".  A fast and simple way to retain a distribution list from an email you received.  People get copied all the time using distribution lists they may want to reuse easily, like school, sports or work groups.  Oh well.
    How is that any different from adding them to Contacts? Here's the feedback page: http://www.apple.com/feedback/
    There is a set of Mail Scripts that has a function to Add Addresses from an email to any group. But, it doesn't work with Mountain Lion.

  • Is there a way to create a "Horizontal Links List" from a query?

    Hi,
    Is there a way to create a "Horizontal Links List" from a query?
    I want to display file names that I have uploaded as links to a display page.
    I don't know how to create my own template yet as I've read... I saw Jes had posted this idea...
    Thanks, Bill

    Yes, that is great Chris!
    Thanks for the site....
    Once I dynamically create the HTML for the list how do I feed it into the page?
    as an item? Can I access an HTML region body dynamically?
    Thanks, Bill

  • How can I create a list from the e-mail addresses "To:" field of an e-mail?

    Is there a way to automatically create a mailing list from a list of people who have received an e-mail? I know how to create a list manually, but there are a lot of e-mail addresses, so this would be an incredibly tedious process.
    Thanks!

    https://getsatisfaction.com/mozilla_messaging/topics/how_to_create_a_mailing_list_from_a_list_of_email_recipients
    Install the add-on and right-click any recipient in the To: field in the Header Pane.

  • Cannot create mysites from powershell: Original XSLT List View Web Part not found

    I have a bizarre problem in my SharePoint 2013 farm. This does not occur in my test farm, only in the farm we were going to go live with.
    I'm on windows Server 2012, SQLServer 2012 SP1, SharePoint 2013 April CU. 1 appserver/centraladmin server, 2 web servers.
    When I log into our mysitehost and click newsfeed, it will create a mysite (even though first it displays "we are sorry there was a problem creating your site")
    But from powershell, whether I use $UserProfile.CreatePersonalSite() or New-SPSite, I get the following error:
    Original XSLT List View Web Part not found
    So far I've only found one other person with this:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2503e42c-e114-4e89-8e00-89fe70f0b154/cannot-create-sharepoint-mysite-programmatically
    This is a brand new farm, created with the same scripts I created my test farm with, and same version of SharePoint. Only the service accounts are different. (Farm account has admin on the servers right now since I was setting up profile service).
    Some other errors from the same correlation ID that look related:
    It can't seem to find the listemplate 101
    And something looks wrong with the MySiteDocumentLibrary feature
    I have tried the following:
    1. run psconfig.exe on each server
    2. install-spfeature -AllExistingFeatures
    3. looped through the directory under Features and for each called Install-SPFeature $dirname -Force
    4. uninstalled and reinstalled MySiteDocumentLibrary feature
    5. blew away the whole farm (removed all servers from farm, deleted all databases) and recreated it.
    6. tried creating the UPA from the CentralAdmin gui.
    The only real difference I can think of between the working farm and non working farm is, I installed the working farm using RTM, then as they came out added the March PU and April CU. For this farm I installed RTM and March and April, and then ran my build
    farm script.
    I am at a loss. What do I need to do, re-install the binaries? That's all I can think of. What I love is that our test / POC system worked fine, and now 2 weeks before go-live I'm seeing errors on the production servers I've never seen before. Using the
    same scripts no less.
    Feature Activation: Feature 'Fields' (ID: 'ca7bd552-10b1-4563-85b9-5ed1d39c962a') was activated
    Feature Activation: Feature 'CTypes' (ID: '695b6570-a48b-4a8e-8ea5-26ea7fc1d162') was activated
    No document templates uploaded for list "$Resources:core,global_onet_solutiongallery_list;" -- none found for list template "100"
    Failed to find <ListTemplate> tag corresponding to ID "101", tried both onet.xml for site definition ID "0" language "1033" and global site definition. Operation failed.
    No document templates uploaded for list "$Resources:core,stylelibraryList;" -- none found for list template "121".
    System.Runtime.InteropServices.COMException: A user may not remove his or her own account from a site collection.<nativehr>0x81020051</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPUserCollection.UpdateMembers
    Feature Activation: Feature 'MySitePersonalSite' (ID: 'f661430e-c155-438e-a7c6-c68648f1b119') was activated
    Feature Activation: Activating Feature 'MySiteDocumentLibrary'
    Calling 'FeatureActivated' method of SPFeatureReceiver for Feature 'MySiteDocumentLibrary'
    SharePoint Foundation Upgrade MySiteDocumentLibraryFeatureReceiveraj08n INFO Creating new My Documents library
    Unknown SPRequest error occurred. More information: 0x80070002
    SPRequest.GetMetadataForUrl: UserPrincipalName=, AppPrincipalName= ,bstrUrl=http://contoso/personal/cbuchholz/DOCUMENTS ,METADATAFLAGS=59
    System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPWeb.GetObjectForUrl at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.GetSPObjectFromUrl ...
    <nativehr>0x80070002</nativehr><nativestack></nativestack>There is no Web named "/personal/cbuchholz/DOCUMENTS"
    Possible mismatch between the reported error with code = 0x81070504 and message: "There is no Web named "/personal/cbuchholz/DOCUMENTS"." and the returned error with code 0x80070002.
    Attemping to add webpart id 0F6072F2-E804-4CFD-837E-BB37332B9D1C to web http://contoso/personal/cbuchholz
    Adding XsltListViewWebPart calling SPRequest::CreateListViewPart. Web part id 0F6072F2-E804-4CFD-837E-BB37332B9D1C, web http://contoso/personal/cbuchholz
    Feature receiver assembly 'Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c', class 'Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryFeatureReceiver', method 'FeatureActivated' for feature 'e9c0ff81-d821-4771-8b4c-246aa7e5e9eb' threw an exception: System.InvalidOperationException: Original XSLT List View Web Part not found at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.ReplaceListViewWebPart
    Feature Activation: Threw an exception, attempting to roll back. Feature 'MySiteDocumentLibrary'
    Exception in EnsureFeaturesActivatedAtSite: System.InvalidOperationException: Original XSLT List View Web Part not found
    Failed to activate site-collection-scoped features for template 'SPSPERS#2' in site collection 'http://contoso/personal/cbuchholz'
    Failed to apply template "SPSPERS#2" to web at URL "http://contoso/personal/cbuchholz
    I've had other problems in this farm: the bug where when you add Administrators to a Search Service via the Manage Service Applications page, it removes the SPSearchDBAdmin role from the search service process account. That one did not happen in the other farm.
    At least other people have that one and I could just use the farm admin instead (still troublng of course).

    Ok,
    Here is the problem:
    When creating a mysite from powershell or script, apparently you can ONLY do this from a wfe (or a server running Microsoft SharePoint Foundation Web Application in services on server).
    You CANNOT create mysites from script on your appserver if it is not also a Web Application Server. I confirmed the same is true in my test farm. I guess I was always running most of these scripts on the webserver.
    I searched all over and cannot find this documented anywhere.
    Who do I contact to have Microsoft document this?
    It's Thursday morning, I've been working non stop since Saturday morning so you don't have to :)

  • Creating smartform from attachment list of service object

    Hi,
       How can i create a smartform containing attachment list from generic object services(active workflow Box) in tcode VA02, Also let me know in which table this attachment lists are stored.
    Thanks,
       JP

    I found following Solution:
    I copied the following classes and changed them in some way to fit my requirements:
    1.CL_GOS_ATTACHMENTS
    2.CL_GOS_SRV_ATTACHMENT_LIST
    3.CL_LIST_BROWSER
    Changes to the Classes:
    1.Type of the attribute GO_INSTANCE changed to ZCL_GOS_ATTACHMENTS.
       Changed method INIT_BROWSER:
    go_browser ?=
        zcl_list_browser=>zcreate_browser( cl_browser=>gc_list_browser ).
    2.Type of the attribute GO_ATTACHMENT_LIST changed to ZCL_GOS_ATTACHMENTS
    3. Copied Method CREATE_BROWSER of Class CL_BROWSER to ZCREATE_BROWSER:
    method zcreate_browser.
      case ip_btype.
        when gc_list_browser.
          *create object ro_browser type zcl_list_browser.*
        when gc_tree_browser.
          create object ro_browser type cl_tree_column_browser.
        when others.
          raise exception type cx_sobl_browser
            exporting
              gp_error = cx_sobl_browser=>gc_wrong_type
          exit.
      endcase.
    endmethod.
    Modified the code of method ___DISPLAY to my needs.

  • How do I create a Group email list from my contacts??

    I can't figure out how to create a Group email list from my contacts on my iPhone??

    I thought that was how I did it before ( a year ago ) but the group is created in my Email software but the group won't synch to my phone?! However it will synch randomly - i.e. singular new emails synch from my phone to my computer, but I am not noticing the computer transferring data to my phone...same with calendar...hmmm, maybe that's the problem - issue synching anything entered into my computer first...anyone hear of this? It seems that this started about a month ago, I had to restore my phone and it would not restore with the most recent backup, so I had to go back a couple of back ups... since it has been glitchy! HELP!

  • List teamplate (template created on migrated custom list from SP 2010 to 2013) not appearing in Add an app section in SP 2013

    We have migrated from SP 2010 to SP 2013. When we are trying to create list template from the migrated OOB custom list. List template successfully created but it is not appearing in Add an app section in SP 2013.

    Please make sure you have activated "Team Collaboration Lists" feature under Site Features. Also check if the template in the list template gallery is published.

  • Is it possible to create a list using the addresses in the "TO" list from a received email?

    I have a very large group I'd like to create an email list for. I don't want to have to search in my address book for every address that needs to go into it. Is there away that I can use an email that I've received which has been sent to every member I want in the list - all are listed in the "To" portion of the header - and create a list from those addresses? Thanks.

    I know how to do that. I don't want to have to take the time to search through the gazillion addresses in my address book to find each one and then drag or type them into the list. My question was is there away to have all the addresses in the "To" field used to create a list by - for instance - somehow selecting all of these addresses and saying create a list from them. Or clicking on an option that would give me the ability to create a list from all the addresses in the "To" field of a specific email. Thanks.

  • Create choose from list in Report selection criteria

    Hi all,
    Is it possible to create a choose from list in UDF in a Report selection criteria ?
    My issue is i just want to create a report using crystal report. In this report contain some parameter which the parameter choose from list value is come from a UDT. If the value come from OCRD or OITM , it's so easy to make. I just make Customer @From OCRD in parameter CR, then i just preview, it will make choose from list from business partner. But how about from UDT.
    I have try to make it using Formatted search. So in SAP B1, i binded with formatted search in some parameter that i make it in CR. But there is some thing odd. if I make 2 different report with  different parameter. The formatted search with binded in the first report, will also binded in the second report. And i don't want this happen.
    How can i make it , the formatted search didn't  binded in second report parameter, because the second report is totally different. ?
    thanks in advance
    regards
    Jia shun

    Hi Jia
    Try this
    @UDT
         Code          Alpha(8)
         Name          Alphe(30)
         Fields      etc
    Define the parameter token as follows.
    Season@SELECT DISTINCT T1.Code, T1.Name FROM OADM T0 CROSS JOIN "@UDT" T1
    OADM only has one record so the join will return the right number of records.
    Hope this helps
    Rob

  • Best way to create a conact list from the user profile properties

    We have a customer looking for a phone book utility, starting with a table showing main user information and with some search options. We would like o base it on the user profile properties and not to create an indipendent studion record browser porlet.
    What is best way to create a conact list from the user profile properties ?

    I did something like this using search.  It can get messy, so you need to take care with it.
    * Identify the properties you want to make accessible to search (ex: name, etc.)
            - add them to the user property map
            - flag them as searchable
    * I broke down and used the native server API.  I'd still suggest this approach.
    * Write some simple code to do vcard export if you like
    (my code is all in vb.net)
    I really believe this is the &#034;right&#034; approach, but honestly, this was a bit painful and has been
    messy for us given some other business issues.  (to my chagrin we have users with 2-letter last
    names...)
    I have code you're welcome to poke at, but it's more or less slapped together and has various
    different search methods commented out so you can see how I tinkered w/ the remote vs. server
    API.
    If you'd like it mail me at [email protected] and I'll send you a zipped copy w/ a
    readme.  I hope it may be useful to you as both a starting reference.

Maybe you are looking for