QuestionProperty class

From Catglobe Wiki
Jump to: navigation, search

QuestionProperty



The question property.

Parent class

Inherits from object

Methods

  • (From object) string ToString() - The string representation of the object.

Properties

  • int GridNumber { get; } - Get GridNumber of the question property
  • bool HasText { get; } - Get HasText of the question property
  • int Id { get; } - Get id of the question property
  • bool IsSpecialText { get; } - Get IsSpecialText of the question property
  • string Name { get; } - Get Name of the question property
  • string ObjectTypeName { get; } - The name of the type of object.
  • int QuestionID { get; } - Get QuestionID of the question property
  • Dictionary QuestionPropertyLanguages { get; } - Get QuestionPropertyLanguages of the question property. Only valid when HasText is true
  • LocalizedString QuestionPropertyLanguagesLocalized { get; } - Same as QuestionPropertyLanguages, just different container
  • int QuestionPropertyType { get; } - Get QuestionPropertyType of the question property
  • string QuestionPropertyTypeAsString { get; } - Get QuestionPropertyType as string of the question property
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.
  • string TypeValue { get; } - Get TypeValue of the question property
  • string Value { get; } - Get Value of the question property. Only valid when HasText is false


Examples

// Example to get Export/Report label on "Q7"

2019-02-19 10-40-32.png

string questionName = "Q7";
number qnaireRId = 15644863;
array questionProperty = getQuestionProperties(questionName, qnaireRId);
for(number i = 0; i < questionProperty.Count; i++) 
{
	QuestionProperty qp = questionProperty[i];
	print(qp.QuestionPropertyType);//97
	print(qp.QuestionPropertyLanguages);//{"da-DK": Export Report label in DK, "en-GB": Export Report label in UK}
	print(qp.QuestionPropertyLanguagesLocalized.GetTranslationForLoggedInUser());//Export Report label in UK
	print(qp.QuestionPropertyLanguagesLocalized.GetSpecificTranslation("da-DK"));//Export Report label in DK
}