0

I'm having trouble calling the field data in some javascript.

Basically I need:

videoFilename = 'Name that user puts into Video Name field'

I thought perhaps i could just add it like in a workflow, but i'm not seeing an option for that.

1
  • I guess we need a bit more information on this. What are you trying to achieve? is the javascript in edit- or newform? Commented Apr 22, 2016 at 7:59

2 Answers 2

0

Have you tried checking the XML via REST?

http://contoso.com/_api/lists/getbytitle('Listname')/items

Then you should get the XML output and can check what the column is called. e.G. I get my Attachment Url and Attachment Description like this:

<script type="text/javascript">

    $(document).ready(function() {

        // Rest URL
        var requestUri = "/_api/lists/getbytitle('Marketplace')/items?$select=Title,ID,Attachments,AttachmentFiles&$expand=AttachmentFiles";

            $.ajax({
                url: requestUri,
                type: "GET",
                headers: { "ACCEPT": "application/json;odata=verbose" },
                success: function (data) {

                    $.each(data.d.results, function (i, item){
                        var title = item.Title;
                        var id = item.ID;
                        var attachmentUrl = item.AttachmentFiles.results[0];

                        //alert(attachmentUrl.FileName);
                        //alert(attachmentUrl.ServerRelativeUrl);

                    })
                },
                error: function () {
                    alert("Error getting the Marketplace Items");
                }                     
            });
      });      

</script>

Maybe this will help you to get your Video filename.

0

I ended up finding it by searching the nearest td.

var videoFilename = $('h3:contains("Video Filename")').closest('td').next('td').text().trim(),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.