GetLoopStructure

Description

Get LoopStructure (Only Loops)

It is not possible to update a LoopStructure
Signature
SurveySchema GetLoopStructure(string key, string projectId, SchemaSourceType schemaSource)

Parameters

Name Data Type Description

key

string required

The authentication key

projectId

string required

ID of the project

schemaSource

SchemaSourceType required

Designtime/RuntimeProduction/RuntimeTest

Response

Data Type Description

ObjectStructure containing the Node

Example

// Create instance of the webservice
var authoring = new AuthoringSoapClient();

//***************************************************
//
// Get the loopstructure, pick one loop,
// get all subforms and change their name, finally update
//
//***************************************************

// Get loopstructure
SurveySchema def = authoring.GetLoopStructure(key,projectID,SchemaSourceType.Design);

// Check that we got at least one loop
if (def.Root.Nodes.Length == 0)
	throwError();

// Get the first Loop
Loop loop = (Loop)def.Root.Nodes.GetValue(0);

// Configure ReadFilter
ReadFilter readFilter =
	AuthoringUtil.NewReadFilter(false,false,true,true);

// Get all forms under the loop
// (not including subloops and forms under subloops
def = authoring.GetFormsInLoop(key,projectID,loop,readFilter,SchemaSourceType.Design);

// Make iterator for the forms
IEnumerator e = def.Root.Nodes.GetEnumerator();

// Iterate through all forms and change their name
while (e.MoveNext())
	((FormBase)e.Current).Name += "_iterated";

// Update
authoring.Update(key,projectID,def);