SharePoint survey: How to define question fields when retrieving survey information from the Lists web service?

I want to get survey information through a list of web services and display the questions in the survey.

The result contains a large number of Field nodes , some of which are questions in the survey. Other fields contain other information such as author, last modified, etc.

How can I choose questions? I thought that all non-questions would be hidden, but it is not.

Here is my code as of now. It returns about 16 items. The survey has 6 questions ...

// read question definitions
string[] HandleTypes = new string[] { "Number", "DateTime", "Text", "Choice", "GridChoice", "Boolean" };
var query = from n in node.Descendants(ns+"Field")
            where (n.Attribute("Hidden") == null || n.Attribute("Hidden").Value.ToLower() == "true")
            && (n.Attribute("Type") != null && HandleTypes.Contains(n.Attribute("Type").Value))
            select new Question(n.Attribute("ID").Value)
            {
                Text = n.Attribute("DisplayName").Value,
                QuestionType = n.Attribute("Type").Value,
                Element = n
            };

Anyone ideas?

+3
source share
4 answers

"SourceID" - GUID. SourceID "http://schema..."

+1

, InternalName , , , . , , , "Title", "Created", "Author" . , : http://www.johnholliday.net/downloads/fieldswss.htm

0

SPField.Group, , "Base", ID/Author .., , .

The page separator is a special type of field so you can get them

if (SPField.Type == SPFieldTypes.PageSeperator)
0
source

It looks like he considers all new columns (not one of the parent content types) as questions. One way to get only questions is to capture all the fields that are in the Overview view (except for the Author column); another way would be to capture all fields that do not come from the parent content type, i.e. new fields.

0
source

Source: https://habr.com/ru/post/1737114/


All Articles