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 |
Example
// Create instance of the webservice
var SurveyDesign = new SurveyDesignSoapClient();
//***************************************************
//
// Get the loopstructure, pick one loop,
// get all subforms and change their name, finally update
//
//***************************************************
// Get loopstructure
SurveySchema def = SurveyDesign.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 =
SurveyDesignUtil.NewReadFilter(false,false,true,true);
// Get all forms under the loop
// (not including subloops and forms under subloops
def = SurveyDesign.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
SurveyDesign.Update(key,projectID,def);