From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
Line 10: Line 10:
 
===Get row index based on column values===
 
===Get row index based on column values===
  
;<code>[gn:act_getRowIndex]|[source,target;column{n};source{n}]</code>
+
:;<code>[gn:act_getRowIndex]|[source,target;column{n};source{n}]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[source]]
+
| <code>[[source]]</code>
 
| [[source]] from where the row index will be retrieved
 
| [[source]] from where the row index will be retrieved
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#rows|rows]]
+
** <code>[[Datatypes#rows|rows]]</code>
** [[Datatypes#rowsColumn|rowsColumn]]
+
** <code>[[Datatypes#rowsColumn|rowsColumn]]</code>
 
|-
 
|-
| [[target]]
+
| <code>[[target]]</code>
 
| [[target]] where the row index will be stored
 
| [[target]] where the row index will be stored
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#number|number]]  
+
** <code>[[Datatypes#number|number]] </code>
 
|-
 
|-
| [[configuration.xml#Column|column]]{n}
+
| <code>[[configuration.xml#Column|column]]{n}</code>
| [[configuration.xml#Column|column]] where the value from [[source]]{n} will be compared  
+
| [[configuration.xml#Column|column]] where the value from <code>[[source]]{n}</code> will be compared  
 
|-
 
|-
| [[source]]{n}
+
| <code>[[source]]{n}</code>
 
| [[source]] from which the value will be compared with [[configuration.xml#Column|column]] value and if the row matches, row index will be returned
 
| [[source]] from which the value will be compared with [[configuration.xml#Column|column]] value and if the row matches, row index will be returned
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#text|text]]
+
** <code>[[Datatypes#text|text]]</code>
 
|-
 
|-
 
|}
 
|}
  
 
====Example====
 
====Example====
<code>@variable/rowIndexTest</code> - source<br>
+
:<code>@variable/rowIndexTest</code> - source<br>
<code>@+id/rowIndex</code> - target<br>
+
:<code>@+id/rowIndex</code> - target<br>
<code>resident_lastName</code> - search column name<br>
+
:<code>resident_lastName</code> - search column name<br>
<code>@+id/lastName</code> - search source<br><br>
+
:<code>@+id/lastName</code> - search source<br>
<code>[gn:act_getRowIndex]|[@variable/rowIndexTest,@+id/rowIndex;resident_lastName;@+id/lastName]</code>
+
:; ⤷ <code>[gn:act_getRowIndex]|[@variable/rowIndexTest,@+id/rowIndex;resident_lastName;@+id/lastName]</code>
 
<hr>
 
<hr>

Revision as of 16:28, 12 July 2017

gn:act_getRowIndex

Description
Returns index of first matching row with defined values
Action returns
void

Action signatures

Get row index based on column values

[gn:act_getRowIndex]|[source,target;column{n};source{n}]
Parameter Description
source source from where the row index will be retrieved
target target where the row index will be stored
column{n} column where the value from source{n} will be compared
source{n} source from which the value will be compared with column value and if the row matches, row index will be returned

Example

@variable/rowIndexTest - source
@+id/rowIndex - target
resident_lastName - search column name
@+id/lastName - search source
[gn:act_getRowIndex]|[@variable/rowIndexTest,@+id/rowIndex;resident_lastName;@+id/lastName]