How to fetch Properties of all Survey Lists from site collection using Java Script in SharePoint 2013

Hi,
I am trying to fetch properties of all lists of "Survey Type" from my site collection in SharePoint 2013 using script editor web part. I am able to fetch properties of one list by mentioning its name explicitly in code but not all survey
list.
My task is to display Survey name , description ,Time created and URLs of all survey lists using java script in script editor web part.
And let me know , if there is any other OOB feature of SharePoint 2013 to achieve the same. 
Here is the code  :
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
function sharePointReady() {
     GetSurveyList();
 function GetSurveyList() {
        var spListTitle = " List Name";
         var clientContext = new SP.ClientContext.get_current();
        var oWeb = clientContext.get_web();
        this.surveyList = oWeb.get_lists().getByTitle(spListTitle);
        clientContext.load(surveyList);
        clientContext.executeQueryAsync(Function.createDelegate(this, this.GetListProperties),Function.createDelegate(this, this.onFailure));
 function GetListProperties() {
        $("#SurveyList").text("");
        var surveyTable = "<table border=1>";
        surveyTable = surveyTable.concat("<tr><td>Survey Name</td>");
        surveyTable = surveyTable.concat("<td>Survey Description</td>");
        surveyTable = surveyTable.concat("<td>Time Created</td>");
        surveyTable = surveyTable.concat("<tr><td>" + surveyList.get_title() + "</td>");
        surveyTable = surveyTable.concat("<td>" + surveyList.get_description() + "</td>");
        surveyTable = surveyTable.concat("<td>" + surveyList.get_created().format("MM/dd/yyyy hh:mm tt")+ "</td>");
             surveyTable = surveyTable.concat("</table>");
        $("#SurveyList").append(surveyTable);
    function onFailure(sender, args) {
        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
</script>
<div id="SurveyList"></div>

Shifa,
Please use search result webpart or content query webpart to list all survey list.
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

Similar Messages

  • As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 also how we can insert,update,delete records in list using ECMA script.

    As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 step by step also how we can insert,update,delete records in list using ECMA script.
    Thanks and Regards, Rangnath Mali

    Hi,
    According to your post, my understanding is that you want to use JavaScript to work with SharePoint list.
    To create list items, we can create a ListItemCreationInformation object, set its properties, and pass it as parameter to the addItem(parameters) function
    of the List object.
    To set list item properties, we can use a column indexer to make an assignment, and call the update() function so that changes will take effect when you callexecuteQueryAsync(succeededCallback,
    failedCallback). 
    And to delete a list item, call the deleteObject() function on the object. 
    There is an MSDN article about the details steps of this topic, you can have a look at it.
    How to: Create, Update, and Delete List Items Using JavaScript
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Retrieve all pages in a site collection using powershell command

    Hi all,
    I need to retrieve all pages in a site collection and i wanted to display it in a csv file using powershell command.Please help.
    Regards,
    Praveen

    Hi Praveen,
    Here are two blogs would be helpful:
    PowerShell script to Enumerate Sites, Sub-sites and print them in a .csv file
    http://www.sharepointfix.com/2012/02/powershell-script-to-enumerate-sites.html
    Powershell to Loop through all SharePoint sites and pages
    https://tjendarta.wordpress.com/2013/03/19/powershell-to-loop-through-all-sharepoint-sites-and-pages/
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to auto add in pdf filename (shown in footer) by using Java Script?

    In order to have nice tracking a document, I want to print the file name as a header or footer when printing the documents. 
    How can this be done?  
    Found a perfectly nice post related to same issue
     http://forums.adobe.com/thread/302996 
     (Many thanks on every contribuitors inside that posts)  
     In the above post,  found that ##Reinhard had shared some well nice scripts for "enable to put in filename in the footer for every document, just by 1 simple click in each documents"  
    For the time being, 
    if i would like to generate a script that allowing 
    1) Only adding / showning the pdf filename in the footer
    2) Auto Run/Execute on this script for all documents, which means without any click but it will auto showing the "filename at footer" when any document opening.  
    Hope any experts can give a help on this.   
    PS: Currently using Adobe Acrobat 10 & Reader 11 // OS = Windows 7 
    Many thanks ^^

    My code for above method is Floor #2
    var FileNM = this.documentFileName;
    for (var p = 0; p < this.numPages; p++)
    var fd = this.addField("xftDate", "text", p, [30,15, 290,30]);
    fd.textSize=5; fd.value = " (" + FileNM +")";
    It works for me & my PC, however I unable to applied same things into a JavaScript.js file
    Hope any experts could help and advice.
    Many thanks.

  • How to fetch what are all the tables used in this TR no and Package name of

    Hi Friends,
    I have input of Transport Request no (E070-TRKORR).
    How to fetch what are all the tables used in this TR no and Package name of this Table.

    HI,
    FYI
    SELECT E071OBJECT_NAME, E070MDEVCLASS
    FROM E071, E070M
    WHERE TRKORR = YOU REQUEST NO.

  • How do i erase a corrupt contact list from iCloud,iPhone, iPad and MacBook Pro and restore Address Book backup to all devices and cloud?

    how do i erase a corrupt contact list from iCloud,iPhone, iPad and MacBook Pro and restore Address Book backup to all devices and cloud?
    I saved a corrected, most up to date version of my master Address Book Contacts as a back-up on my Mac Book Pro.
    then in an effort to "simplify my life"  i attempted to sync my I phone contacts - ( pre clean-up version) with my clean list on Mac Book Pro, New I pad and newly available icloud. DUH!! Using iTunes to do the sync caused the clean MacBOOK Pro list to be commingled with the dirty iphone contacts. amd now the whole mess is in the cloud. 
    I need to clear out the contaminated lists from all iplaces, and startover with Back-up on my macbook pro. BUT HOW???
    Help
    Karen

    I had exported an address book backup: abbu
    so since i wrote, i have found my way into the cloud: selected all entries - deleted them all from the cloud.
    This wiped out contacts on my iphone and i pad, and MBP, as well as on the cloud.  I then imported the abbu back into my now empty address book. 
    To repopulate the crowd, i selected all in my address book and created a single card vCard for export to my desktop.  I then dragged that vcard into my empty cloud.  Now my cloud has the same clean contacts as my MBP addressbook.  The cloud then pushed the clean contacts into my empty ipad and iphone contacts. 
    I had to go back to Address Book>preferences>Accounts and Add an I cloud account - but if you accidentally create a second i cloud account - all of a sudden your address book will duplicate itself.  I quickly reversed it by deleting one of the icloud accounts in my Address Book>preferences>Accounts. 
    I created a new entry on my MBP and it is now on all devices and in cloud
    I also created a new entry on my iPhone and it is now in the address book on my MBP.
    I feel empowered!!
    Have i missed anything??

  • How can I remove 'Open all in tabs' from my bookmarks?

    How can I remove 'Open all in tabs' from my bookmarks? It's very annoying when you click on it by error. I downgraded from 29 to 28 because of the various bookmark issues I was having. I never had this issue with previous version of FF, why did they have to mess with stuff that was working.
    I love the new layout. Thanks

    Firefox 28 contains security vulnerabilities. It's best to start a new thread (ask a new question) about the other issues you're having with Firefox 29 and resolve them.
    * https://www.mozilla.org/security/known-vulnerabilities/firefox.html
    # Install Stylish and restart Firefox when prompted.
    #* https://addons.mozilla.org/firefox/addon/stylish/
    # Open the Add-ons Manager (Ctrl+Shift+A).
    # Click User Styles on the left.
    # Click the Write New Style button at the top. Paste the following in the text box, give the style a name, then click the Save button.
    <pre><nowiki>
    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
    #BMB_bookmarksPopup .openintabs-menuitem,
    #bookmarksMenuPopup .openintabs-menuitem {
    display: none !important;
    </nowiki></pre>
    If you don't want to install an add-on, you can use the ''userChrome.css'' file instead, but I don't recommend it.
    * http://kb.mozillazine.org/UserChrome.css

  • How to Hide some Rows in a List view Web Part using JavaScript ?

    How to Hide some Rows in a List view Web Part using JavaScript ?

     Here is the code that worked for me:
    var Elements = document.querySelectorAll('div[id=WebPartWPQ3] table[class=ms-listviewtable]>tbody tr .ms-vb-lastCell.ms-cellstyle.ms-vb2')
    for(var i=0, n = Elements.length; i < n; i++)
     if(Elements[i].innerHTML=="India")
    Elements[i].parentNode.setAttribute("style","display:none")
    WebPartWPQ3 -> ID of webpart Div
    ms-listviewtable -> class name of table in Div
    ms-vb-lastCell.ms-cellstyle.ms-vb2 -> classname of td to get text

  • HT1382 How can I copy over my contact list from my ipod touch 3 to my new ipod touch 5 ?

    How can I copy over my contact list from my ipod touch 3 to my new ipod touch 5 ??

    Sync it with iTunes on your computer.

  • How to get the list of site collections in wss 2.0 and wss 3.0

    Hi,
    How to get the list of site collections in wss 2.0 and wss 3.0
    Please provide related articles to me
    Thanks in advance

    Use 11 for wss 2.0 and 12 for wss 3.0
    Go to :\Program Files\Common Files\Microsoft Shared\web server extensions\11\BIN\”
    stsadm.exe -o enumsites -url <root url>
    to get the list  of site collections and 
    stsadm.exe -o enumsubwebs -url <root url>
    to get the list of sub sites.
    http://support.microsoft.com/kb/832807
    http://ServerName/_layouts/1033/Siteusrs.aspx to manage permissions

  • As a new iPad user how do I transfer my email contacts list from my PCM to my ipad

    How do I transfer my email contacts list from a laptop to my iPad?

    Hi - Thanks for your response.  I have tried to find the answer in the manual, but cannot locate the exact solution.
    Do I have to sync with iTunes? Does the iPhone just learn the addresses as I use it for email?  I'm confused because the "My Contacts" list that was transferred using VZ Contact Transfer is for cell phone numbers, not email addresses. But on my MacBook Pro I have "Address Book" with email addresses - that's what I want to transfer.  I'm a beginner with the iPhone - had a little basic flip-top LG for years. What a difference!!

  • How do i re-download all my music from icloud to my mac

    how do i re-download all my music from icloud to my mac

    iCloud does not have your music, don't waste time looking there. In iTunes you can download all the music originally purchased using iTunes, additionally,  and only if you have iTunes Match you can download all of the music in your library regardless of where you got it.
    iCloud is not a backup system, relying on it instead of a real backup will eventually cost you your stuff.

  • How come when I open Safari, all my windows from my previous use are open?

    How come Safari opens all the windows from my previous use of Safari when it is opened?

    That is probably because you never closed the program. It keeps running in the background. To close it completely, open Safari, go to the Safari tab on top of e screen and select Close...

  • How do I close the played songs list from the miniplayer?

    How do I close the played songs list from the miniplayer?

    Click on the same 3 bar symbol that opened it.
    tt2

  • How to  build a  Calculator in WAB Template  by using  Java Script......

    Hi ,
    I am  trying   to build a dynamic  calculator in WAD which is as  similar to one in Executive view in Cognos. The  problem i am  facing  is,  i can  able to build a normal  calculator  by using  java script  but  i am  unable  to read the  key figure  values from  the  analysis  item  on from the  data  provider  in to  by  calculator  by using  on click  function. I wanted  to get the all  the  values in to a internal excel , so  that  my calculator can read the  values from  that. can  any  one  help  me  on getting  values in to internal excel by using   java before the  executing the  web template ?...
    Thanks in advance....
    Jhon.
    Edited by: sap bw on Jul 31, 2008 5:51 PM
    Edited by: sap bw on Jul 31, 2008 5:52 PM

    I might not be understanding your question completely since you mention WAD and then Excel, but if you are asking how to get the key figure values using Javascript in WAD, you can go to the Dataprovider properties and enable 'Output Result Data'.  This will embed an XML element into the HTML output that you can then parse using standard Javascript DOM navigation.
    Hope this helps.

Maybe you are looking for

  • Runtime error (idoc-file)

    Hi  experts iam working on IDOC-file scenarion. after mapping design i have tesed my message mapping (without any data) iam getting error "RuntimeException in Message-Mapping transformation: Unparseable date: "" then i tetsed the scenario end to end

  • HT1430 My inbox will not display all messages

    My inbox will not display all messages

  • Storage Bin & storage Loc. via  LSMW

    Dear all, I want to upload sto. Bin & Sto. loc from old sap system to new SAP system via LSMW. So please provide any link showing step by step method for using LSMW for Sto. BIn & Sto Loc uploading. Regards, Rocky Edited by: Csaba Szommer on Aug 29,

  • On my Mac OS X ver10.4.11 my Sync is disabled can anyone tell me how to reverse this?

    On my Mac OS X ver10.4.11 my Sync is disabled can anyone tell me how to reverse this? I am not able to sync my iCal with anything. My computer is a Power PC G4.

  • Glitch with Numbers in Mountain Lion

    I upgraded to Mountain Lion and the latest Numbers version and notice a glitch in an existing spreadsheet. I have a column that, before the upgrade, displayed the day, then on the next line the date in M/D/YY format. Like this: Thursday 7/26/12 I had