The below will allow you to copy across item information from one SharePoint list and display them within a task list for approval.
You will need to make sure you have “jquery-3.2.1.min.js” somewhere on your SharePoint site.
- Add HTML Form Webpart and add the <iframe> code below. The ID value of “SelectedPage” is important as this is referenced in the jquery.
- Add Content Editor with code below. You’ll need amend the URLs and GUIDs as appropriate.
HTML Form webpart code |
<iframe id=”selctedPage” src=”” style=’width:650px; height:750px’></iframe> |
Code to link List to Task List |
<script type=”text/javascript” src=”http://YOURSIRETOWHEREJQUERYIS/SiteAssets/Java/jquery-3.2.1.min.js”></script>
<script> //Get paramenter from URL //passing the item id which is fetched from the url }) //function to get querystring parameter from the url, Based on the pasing paramenter it will fetch the value for (var i = 0; i < url.length; i++) { if (urlparam[0] == param) { //Function to get related items from the TASK list, by passing id of the specific item retrieved above $.ajax({ //get all related items, ex-itemid, listID //Get only item id //get item id value //split id alsone var test=firstArray[0].split(“:”) //set the source content of the iframe and pass through the related id //$(‘#savedId’).val(data.d.ID) }, error: function (data) { |