hello,
please can someone give me an example of using structure data type ? in what situations can we use it?
thanks
Hi,
You can read more detail about structure here.
There is an example too.
Cheers,
Khuong
thank you Khuong .
Hello,
Consider these 2 very simple example:
1. You are using SQL tool and output requires few columns from 2 or more entities then you need to create a structure:
Eg : Select Emp.Name, Department.Designation from Emp, Department where Emp.DeptId = Department.DeptId
Here you can just create an structure with these 2 attributes for output. StrEmp => Name, Designation
2. You have to call a server action defined in other module, which requires data from multiple entities as input so instead of declaring multiple Input params, you can declare a single structure which have attributes of data type of those all required entity and use that structure as data type for input param.
Hope it helps!
thank you very much
Hello Dalal,
While developing your application, you may find it interesting to have a variable holding a collection of variables with different data types grouped together and use it in the logic. For example, to assign the values returned by an action where you don't have to create one output for each value.
For information about structures and why to use them please read:
https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Use_Structures_and_Records_to_Create_Compound_Data_Types
Regards,
Daniel
thank you Daniel
the example in the document is advance , I'm a beginner i want a simple example of using a structure .
Here is a simple example:
Assume you need the same group of input, output or local variables in multiple screens or actions.
Rather than copy/pasting the parameters, you could create a structure of these parameters and use the structure everywhere as datatype.
That way, if you require adding a parameter, adding it to the structure will make it available everywhere where the structure is used. The alternative without the structure would require you to add the new parameter on all places manually.
Does that help?
yes very much