Values from a list

Hello,
I have a Question. I made an LDAP query. Now in this query I
have a attribute called "wMUserHistory" The query for this
attribute returns a list like this:
cn=P148348,ou=staff,o=RUG,c=NL,
cn=P141922,ou=staff,o=RUG,c=NL, cn=naam,ou=Adm,o=RUG,c=NL,
cn=P137308,ou=staff,o=RUG,c=NL, cn=P218384,ou=staff,o=RUG,c=NL
What I actually want to do is to remove the characters except
the "Pxxxxxx", but in one case there is a name called "naam". So I
thougt I should get every separate piece of this list:
(cn=P148348,ou=staff,o=RUG is one piece) And remove the characters
separate per piece and then afterwards make a list of it again so I
can use and insert the (correct) data (user history) into a new
table.
I wanted to depend the characters which have to be removed on
the total amount of characters (length) per piece (if length is 27
.... if lenght is 28...... etc)
Is this possible and how do I get the separate pieces from
this list. I know how to remove characters, but I have to know how
I can do it per piece.
Is there someone who can help?
Thank you in advance.
Regards,
Kabbi

I've made some assumptions from viewing your data. Looks like
cn= value is the key and each row has four columns cn,ou,o,c.
Try this:
<!--- *** YOUR DATA --->
<cfset LDAP_data = "cn=P148348,ou=staff,o=RUG,c=NL,
cn=P141922,ou=staff,o=RUG,c=NL, cn=naam,ou=Adm,o=RUG,c=NL,
cn=P137308,ou=staff,o=RUG,c=NL, cn=P218384,ou=staff,o=RUG,c=NL">
<cfset kounter = 0>
<cfloop index="i" list="#LDAP_data#">
<cfset kounter = kounter + 1>
<cfif i CONTAINS "cn=">
<cfset temp_cn = Replace(i,"cn=","","ALL")>
</cfif>
<cfif i CONTAINS "ou=">
<cfset temp_ou = Replace(i,"ou=","","ALL")>
</cfif>
<cfif i CONTAINS "o=">
<cfset temp_o = Replace(i,"o=","","ALL")>
</cfif>
<cfif i CONTAINS "c=">
<cfset temp_c = Replace(i,"c=","","ALL")>
</cfif>
<cfif (kounter MOD 4) EQ 0>
<!--- *** INSERT RECORDS TO NEW EXISTING TABLE --->
<cfquery name="insert_new_table"
datasource="yourDatasource">
INSERT your_new_table VALUES
('#Trim(temp_cn)#','#Trim(temp_ou)#','#Trim(temp_o)#','#Trim(temp_c)#')
</cfquery>
<!--- *** DISPLAY OUTPUT --->
<cfoutput>
cn: #temp_cn# / ou: #temp_ou# / o: #temp_o# / c:
#temp_c#<br>
</cfoutput>
<!--- reset counters and temp variables --->
<cfset kounter = 0>
<cfset temp_cn = "">
<cfset temp_ou = "">
<cfset temp_o = "">
<cfset temp_c = "">
</cfif>
</cfloop>

Similar Messages

  • How to get multiple values from the list

    I've a list of an item which I queried it from the database. I also created a button that will takes a selected items from the list when it was clicked. I used javabean to get the data from database.
    <%     // clicked on Select District Button
    Vector vselectedDistrict = new Vector();
    Vector vdistrictID = new Vector();
    String tmpSelectDistrict = "";
    tmpSelectDistrict = request.getParameter("bSelectDistrict");
    if(tmpSelectDistrict != null)
         // get multiple values from the list
         String[] selectedDistrict = request.getParameterValues("usrTDistrict");
         vselectedDistrict.clear();
         vdistrictID.clear();
         if((selectedDistrict != null) && (selectedDistrict.length != 0))
                             for(int i=0;i<selectedDistrict.length;i++)
                   vselectedDistrict.addElement(selectedDistrict);           
              vdistrictID = dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
              for(int i=0;i<vdistrictID.size();i++)
                   out.println("district = " + selectedDistrict[i]);                         out.println("district ID= " + vdistrictID.get(i).toString());
    %>
    // get vdistrict from the database here......
    <select name="usrTDistrict" size="5" multiple>
    <%     for(int i = 0; i< vdistrict.size(); i++)
    %>
         <option value="<%=vdistrict.get(i).toString()%>"><%=vdistrict.get(i).toString()%></option>
    <%
    %>          
    </select>
    <input type="submit" name="bSelectDistrict" value="Select District">
    Lets say the item that i selected from the list is 'Xplace' and I clicked on the Select District button,
    what I got is this error message:
    org.apache.jasper.JasperException: Unable to convert string 'Xplace' to class java.util.Vector for attribute usrTDistrict: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
    So where is going wrong and what the message means?. Any help very much appreciated. Thanks

    These are just guesses that might hopefully steer you in directions you haven't looked in yet.
    I presume you used triangle brackets (< >) to avoid having the Jive Forum think it was the "italics" tag?
    Are you certain this: dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
    expects a Vector as its second parameter? And returns a Vector?
    I don't believe you've shown how you use the javabean, or its code? Perhaps it should be rewritten to accept an array of strings instead of a Vector?

  • How to get actual value from LOV list

    Like Subject says: How to get actual value from LOV list. Any help will be appreciated.
    Thanks.

    Thanks Shay, I did it with bind variable because I'm not using JSF. Is there any chance to post solution using standard JSTL or HTML expression. I have something like this: LOV displays some Companies names:
    <html:select property="UserJobCompanyId"
                             disabled="${!bindings[\'UserJobCompanyId\'].updateable}"
                             onchange="submitform();">
                  <html:optionsCollection label="prompt" value="index" property="UserJobCompanyId.displayData"/>                                                     
                </html:select>and I want to get CompanyID of selected Company.
    Thanks, again.

  • How to get the value from select list to text box

    Hi,
    I have a select list i want to retrieve the value from select list to text box.
    How can i do that???
    Regards,
    Sakthi.

    Hi Sakthi,
    Yo can use the Java script for that..
    Dynamically the value will come into text box.
    Use the below script.
    <script type="text/javascript">
    function disFormItems()
    var lReturn = $v(here your select list name)
    alert(lReturn);
    document.getElementById(here your text box name).value =lReturn; }
    </script>Cheers,
    Shan

  • Getting multiple values from a list box

    Hi,
    I am not able to get multiple selected values from a list box using the getParameterValues(). I used the following code..
    String[] names=request.getParameterValues("lname");
    can anyone tell me what the error is or is there any other way i can get multiple selected values from a list box.
    Thanks
    Satish

    Fragment 1
    This is the JSP Code am using for testing
    <%
    String[] name =request.getParameterValues("D1");
    if(name.length==1)
    String value=name[0];
    Instead of name.lenght==1 try with name!=null
    Fragment 2
    out.println(value);
    replace the above fragment with
    %>
       <%-- print result -->
       <%=name[0]%>
    <%
    Fragment 3
    else
    %>
    The list box D1 is a multiple select list box.
    If it still doesn't work, check that the checkboxes have the same name as well as different values
    <input type="checkbox" name="D1" value="1">
    <input type="checkbox" name="D1" value="2">I hope this helps :-)
    Good luck
    touco
    ps: i want duke

  • How to update value stored in a table when we select a value from a list

    In my jsp page i have given
    <html:select property="function" >
         <html:option value="select">Select Actions</html:option>
    <html:option value="open">Marks as open</html:option>
    <html:option value="closed">Marks as closed</html:option>
    </html:select>
    I am using lookup dispatch action in action class
    public class LoginAction extends LookupDispatchAction{
    protected Map getKeyMethodMap() {
              Map map=new HashMap ();
              map.put("open","open");
              map.put("closed","closed");
              return map;
    public ActionForward open(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
              System.out.println("success");
              return mapping.findForward("success");
         public ActionForward closed(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
              System.out.println("success");
              return mapping.findForward("success");
    but when i select a value from the list,the corresponding action is not occuring.What should i put in my code??

    Put your code between the code tags, it makes it so much easier to read.
    To do that, just highlight your code and click on the "code" found between " and the circled ?.
    From what I can read of your code I don't even see a table or a list, so i have no idea what you are trying to do. You probably need to show more code.
    JSG

  • How to remove value from pop list in iProcurement Page

    I need to remove a value from POP list. How can I do this? Can I do this using Perosnalization?
    While creating requisition in the approvers page there are two buttons one is Approvers and another is Add_Attachments.
    When I click Add_Attachments button it will open another page there I need enter description and select category from the pop list and define attachment.
    In the category list I need to remove one value. How do i do this.Personalization links not available in this page.
    Please help guys...
    Thanks Advance
    Kumar

    Kumar,
    First you need to find out the data source for the category pop list. Based on that we can suggest how to achieve that requirement as there are many different ways of specifying the data source for a pop list.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Add a value from a list column on a page

    Hi, I am trying to create a help workflow for the users in my organization. My idea is that when a user clicks for help they will get a page describing different questions like below that will display their relevant data. There would be a master list behind
    this that would have all users with their specific information for each help area. 
    Payroll, W2, OT, ... issues contact your {their payroll specialist}                                                      
                                                    Facilities Maintenance contact {facilities person}            
                                          Your HR contact {HR person}
    I know I can filter a list to show only the specific user's data but I don't like the list format for this help page. Is there a way to insert a variable or a link to a specific column in a list and have it filtered for the current user? Or I've seen where
    I can use a workflow to populate variables from the list, can I insert or reference those variables at the correct points within a page?
    Thanks for any help or suggestions!
    Doug Summersett

    I'm not really looking for audience targeting in this case. I'm trying to find a different way to show a list. I want to have help areas on a page but have part of that page pull specific information based on the user logged in as to which row of the overall
    master table. Something like below is what we had imagined. 
    For Payroll issues with:
    Finding our W-2
    Incorrect paycheck
    OT question
    Contact: (Their specific payroll specialist would appear here)
    For Facilities issues with:
    Heat/AC not working
    Electrical wiring
    Contact: (Their specific facilities specialist would appear here)
    I guess I'm just looking for a different way to show a list instead of the default Sharepoint list view. I want to pull an item value from a list and insert it wherever I want on the page. 
    Doug Summersett

  • "An error occurred while attempting to retrieve the KPI value from the list"

    Hi all.
    when I used KPI, this error occured:
    An error occurred while attempting to retrieve the KPI value from the list
    what happened?
    any suggestion.
    thanks.

    Hello,
    Unfortunatly, I don't have the option to re-create my SP list.  I have created my KPI list in the same site as the targeted list.  I have made all items available in the list view, I've tried several different list views, I still get the
    An error occurred while attempting to retrieve the KPI value from the list.
    message. 
    I am at a loss here, I've search the internet high a low and haven't found any helpful info. 
    In MOSS 2007 I've created a list with about 24 columns.  I need a KPI based on one of the columns.  I've tried to creat a view with that one column, I've tried to creat a view with all columns
    and make it the defualt column...  I don't know what else to try here.
    Any help would be very appriciated!
    Cheers,
    ~Bryan

  • After selecting the value from the list box, want to disable checkbox

    hi guru,
    After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
    so please help me on this.
    thanx,
    man

    in PBO,
    loop at screen.
      if screen-name = your textbox's name.
        screen-input = 0.
        modify screen.
      endif.
    endloop.

  • Retrieve Title field values from multiple lists and add into another list

    Hi , Iam trying to retrieve Title field value from multiple lists. and add them into another list. using Javascript. Can any one help me in doing this. Below is the code.. function save() { clientContext = new SP.ClientContext.get_current(); oWebsite = clientContext.get_web(); oList = clientContext.get_web().get_lists().getByTitle('MainList'); clientContext.load(oList); clientContext.executeQueryAsync(OnSucceeded, onQueryFailed); } function GetListItemValue(listName, fieldName) { var list = oWebsite.get_lists().getByTitle(listName); var eventValue = document.getElementById(fieldName).value; eventValue = eventValue.replace(",", ""); var camlQuery = new SP.CamlQuery(); var filterdata = '<view><query><where><eq><fieldref name="Title/"><value type="Text">' + myreqValue.trim() + '</value></fieldref></eq></where></query></view>'; camlQuery.set_viewXml(filterdata); listItems = list.getItems(camlQuery); clientContext.load(list); clientContext.load(listItems, 'Include(Id)'); clientContext.executeQueryAsync(Succeeded,Failed); } function OnSucceeded() { itemCreateInfo = new SP.ListItemCreationInformation(); oListItem = oList.addItem(itemCreateInfo); oListItem.set_item('Title', 'My New Title'); var deptItemLookupField = new SP.FieldLookupValue(); //Problem in below line...I was unable to get ID var getId = GetListItemValue("Listname1", "txtboxname1"); alert("ID" + getId); if (getId != undefined) { deptItemLookupField.set_lookupId(getId); } var getId12 = GetListItemValue("Listname12", "txtboxname12"); alert("ID" + getId12); if (getId12 != undefined) { deptItemLookupField.set_lookupId(getId12); } oListItem.update(); clientContext.executeQueryAsync(itemadded, itemFailed); } function itemadded() { alert('Item added successfully'); } function itemFailed(sender, args) { alert('Item added itemFailed' + args.get_message() + '\n' + args.get_stackTrace()); }
    Raj

    Hi,
    For this requirement, you will need to retrieve all the lists objects you want firstly, then execute the requests one by one to get the value of the Title column using CAML or
    LINQ.
    How to: Retrieve Lists Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185009(v=office.14).aspx
    About
    retrieve list items:
    http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
    You can use
    Promise in your script to make your requests sequentially:
    http://www.shillier.com/archive/2013/03/04/using-promises-with-the-javascript-client-object-model-in-sharepoint-2013.aspx
    http://www.learningsharepoint.com/2013/08/13/using-deferred-and-promise-to-handle-async-calls-in-sharepoint-client-object-model/
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to find max value from a list of numbers stored in a varray?

    hi,
    Can any body help me to get the max value from a list of numbers stored in a varray?
    thanks in advance....
    regards
    LaxmiNarsimha

    Yes. Could you post what you have tried before we start helping you in this?

  • How to get distinct values from a list and display in a ListView webpart.

    Hi,
    I have a requirement in which I need to pull unique/distinct values from a custom list and then display it via a listview webpart. Can any one suggest how this can be done.
    If possible please share the CAMEL query to fetch distinct values from a custom list.
    Thanks,
    Ankit

    Hi Ankit,
    Is there any particular reason that the values need to be shown in a list view web part?  Are you going to use that web part for filtering via web part connections?
    I ask because the enterprise site collection features include the SharePoint List Filter web part, which may accomplish what you're looking for.
    If you just need to display the values in a grid view, you might have more luck with the JavaScript Client Object Model.  Try putting the following in a text file:
    <style>
    .CustomTableClass{display:table;table-layout:fixed}
    .CustomRowClass{display:table-row;}
    </style>
    <div id="distinct_values_div" class="CustomTableClass">
    <img src="/_layouts/loading.gif" />
    </div>
    <script language="JavaScript" type="text/JavaScript">
    var siteUrl = '/sitecollection/web'; //use the actual subsite URL here
    var listName = 'mylist'; // use the actual list name here
    var field = "Title" // use the actual field you want to display here
    var divToUpdate = document.getElementById("distinct_values_div");
    var rowClass = "CustomRowClass";
    ExecuteOrDelayUntilScriptLoaded(function(){
    var clientContext = new SP.ClientContext(siteUrl);
    var web = clientContext.get_web();
    var lists = web.get_lists();
    var list = lists.getByTitle(listName);
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query></Query><RowLimit>500</RowLimit></View>');
    this.collListItem = list.getItems(camlQuery);
    clientContext.load(collListItem,"Include ("+field+")");
    clientContext.executeQueryAsync(
    Function.createDelegate(this, this.onQuerySucceeded),
    Function.createDelegate(this, this.onQueryFailed));
    },"sp.js");
    function onQueryFailed(sender, args){
    divToUpdate.innerHTML = 'Unable to retrieve values: '+args.get_message());
    function onQuerySucceeded(sender, args){
    var allValues = [];
    var listItemEnumerator = collListItem.getEnumerator();
    divToUpdate.innerHTML = "";
    while(listItemEnumerator.moveNext()){
    var listItem = listItemEnumerator.get_current();
    if(!containsString(allValues,listItem.get_item(field)){
    var value = listItem.get_item(field);
    allValues.push(value);
    var newDiv = document.createElement("div");
    newDiv.className = rowClass;
    newDiv.innerHTML = value;
    divToUpdate.appendChild(newDiv);
    function containsString(strArray, text){
    var contains = false;
    for (var i=0; i<strArray.length; i++){
    if(strArray[i]==text){contains = true; break;}
    return contains;
    </script>
    Upload the text file to a library on the site, then add a content editor web part to a page where you want the distinct values to appear. In the content editor web part's properties, edit the Content Link so that it links directly to the text file.  This
    will cause the JavaScript to run on the page.

  • Assigning multiple values from a List of Values at detail (table) level

    Hi,
    I have a master detail entry screen. I want to assign multiple values when end user selects an item from the list. The field is at detail level (Table type). I can do it using the "Select one choice" type component (ADF Faces Core) but it doesnt retain the value when I go to the next record. This type of component works fine with the screen with only one record to show (form type). This component has binding with list type.
    If I use simple list with Table binding, I can not assign values to multiple items. This type of list retains value when record is changed.
    Can anyone help me resolving this issue?
    Thanks,
    CAH

    Post on Jdev forum JDeveloper and OC4J 11g Technology Preview
    --Shiv                                                                                                                                                                               

  • Problem in getting selected values from multiselect list

    Hi,
    I have two multiselect listboxes in my page. In List1 the data will be retrieved from DB and listed.I will have buttons to move the values from List1 to List2 and viceversa.
    After selecting the needed values,I can rearrange them in List2 using some buttons. I have coded this moving and reordering using javascript.
    What happens is while submitting the page I want the values from list2 which are rearranged. But im getting the order in which I moved from list1 to list2.
    I am using html:selectfor both lists
    List1
    <html:select name="CustForm" property="custName" multiple="true" size="10">
           <html optionsCollection property="CustomerNames" value="custName" label="id"/>
    </html:select>I am having a customer form which has a arraylist CustomerNames. This arraylist has customer bean which has proeprties custName and id. The custForm also has a String custName.
    List2
    <html:select name="CustForm" property="selectedCustName" multiple="true" size="10">
           <html  option value=""/>
    </html:select> The custForm also has a String[] selectedCustNames from where I get the selected values in list2
    Please let me know what am I doing wrong here.

    use a treeSelectionListener, that will give you all the selection changes you need.
    thomas

  • How to get the selected values from multiselected list

    Hi,
    I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
    This is how it looks:
    P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
    If user chooses 2004 and 2007
    then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
    Any help is appreciated!
    Thanks in advance,
    Sapna.

    Hi,
    I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
    This is how it looks:
    P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
    If user chooses 2004 and 2007
    then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
    Any help is appreciated!
    Thanks in advance,
    Sapna.

Maybe you are looking for

  • What Oracle Table contains Partition Key Field Name?

    What Oracle table/view maintains the partition key field name? All_Tab_Partitions does not appear to maintain such information. When I use Toad -> Schema -> Tables -> Partitions, it lists the partition key field name that the partition is based. Than

  • Manual Check issue

    HI, I had to reverse a payment for manual check 200018, cancel the invoice and the GR then reissue the GR and IR and now I want to pay with the same manual check the balance for vendor 477 but I can no longer find check 200018 in the system, not even

  • Can't turn off auto quantizing

    I'm a little new to Logic, but from what I can tell, I've done everything I should.  I'm trying to record 16th note triplets, and the notes show up as triplets in the piano roll while I'm recording, but then are automatically quantized to straight 16

  • WHY NO NEW CLAMSHELLS???

    Would love to see a new flip/clamshell come out its been a while..., perhaps with conversation view text...long battery life.. and an alert display at front. big keys of course with a 2.4 screen ...Not everyone loves a big widescreen smartphone, brin

  • How to delete "other" files on hard drive

    Our 500 hard drive is almost full,  256 of it is labled as other,  how do access these files to deleate them?