Saurabh kumar

Software Developer
About Me
I liked proDT because there is a culture of help and support in this company. The good part about it is tha when any impediment raised it bubbles up to the top people in the hierarchy if it's needed to. So you never feel stranded. Next is you can raise your personal concerns to higher management without any hesitance rather it is encouraged in this culture

Posted Blogs

Written Blogs

Saurabh kumar

WEM No-Code - Reference Data types and their Usage

What is the reference data type?

Reference data type is used to denote a row of a particular list.

For example, if I say I have a reference field of “employee list” and that field has some data assigned to it. This means that the reference field is denoting some row of “employee list”.

When we say data type, It often comes to our mind as a format of data with certain rules and standards. In general programming, we define the datatype of variables and then save the value assigned to it. Likewise for reference data type variables (fields), if there is no data assigned to the field that means it is not denoting any row of the particular list and vice versa.

In short

Reference data type field with data assigned to it  -> Denotes a row of the particular list.

Reference data type field with empty value  ->Does not denote any row.


Structure of reference data type fields

When we define a reference data type field it requires a list associated with itself and a name.

For example, if I want a reference field of “employee list” I’ll select that list whenever I’ll be defining the reference field. Like all the fields you also need to provide a name for the reference field.
If I have to define one reference field of “employee list”. I’ll write the name of the field as “employee” and select ”employee list” as the associated list.


How to get row data from reference fields

We can get any data of the denoted row of the  “employee list” using the “->” operator.

For example “employee list” has multiple columns like employee name, employee no, employee activity status etc. If I want to access the employee name then I can just write an expression like employee(reference field) -> employee name and it will fetch the employee name. If the field is empty then you won’t get any data. (if you are wondering how to assign data to a reference field then I should let you know that part will come later.)


Before learning how to assign data to a reference field we should understand the concept of Row positioning.

Row positioning is clearly defined as the selected row of a list. It is also referred to as the current row of the list in WEM.

Row positioning is dependent on many events which are listed below

  1. Datagrid click(row click, button click inside the row)
  2. Repeater click (div, button)
  3. List action node(add, go to first node, go to next node, reset row position, go to last node, go to previous node)
  4. Loop node (on each iteration of loop row position changes)

Note: If you navigate to a different page using the navigation menu the positioning will be reset which means there will be no row for the current position.


Assignment of reference field

Step 1: Set the row position using above listed events in the “row positioning section”.

Step 2: Select field as assignment node in the flow and then for that node choose “set to current row” option

Eg: let’s say I have a reference field of the employee list named “Emp”. I need to find an employee using employee ID and get the reference and assign it to the reference field “Emp”.

We will take a list action node. Select the “goto first row” action. Apply condition for “goto first row that matches”. The condition will be that the employee ID you want to match should be available in the column of employee ID in the employee table. So we can write something like employee ID field from input = employee ID column of employee table.

Flowchart

Get Free Assessment

Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Message send successfully,
Our executives will contact you soon.
Oops! Something went wrong while submitting the form.