Convert selector component result to single value

05 Apr '19, 09:30 PM
10,744 Views
No Forum Badges

Hi

I'm trying to get single value from database(one integer value: user id) and pass it to Not Null component, but selector component returns table which is not accepted by Not Null component. Someone knows how to do it? Or how should look script in groovy that do this?

 
x 0
Follow
Answer Answer at this question and get points!
No Forum Badges

Hi!

If you are trying to find out if user id exists and then pass it to a Not Null component what you can do is use the selector component and load the table where the user id is located. Then go to the Outline explorer window, right click on the component and click on add---> attribute condition (conditional expression). Once you have created one, give it a meaninful name and select the right attribute (I am guessing user id field on the table). Then on predicate option choose equal. 

Now using a green OK flow bind the selctor and the not null components. And this is the important part, doule click on the green arrow between the components and uncheck Enable Default Binding. On Source (Selector) you should see an option called DataSize.

DataSize (as far as I know) returns 1 if and only if there is a match between the selector and the attribute condition you added to it (which if i am not mistaken should be user id). If it returns 1 it means that there is an user id on the table, hence the data size returning a value of 1. But IT DOES NOT return the id.

I hope this helps you.

 
x 1
Answer at this question and get points!

Related questions

502 proxy error-generate and run add html Adding and deleting from the database Add logging capability to a Groovy script (unit) Add select all to Checkable List Agregar boton de cambio de contraseña en el login AJAX events problem to external JavaScript Alimentar graficas con base de datos Atributos Condicionales heredados Attribute comparison in a selector unit Automatic file upload [beginner] - How to store and browse data collected with BPM app? Business object data Cancellare campi e tabelle dal database Cannot add a Database in the Domain Model Cannot connect to MySQL Cannot insert an entity in the database Cannot invoke method selectSingleNode() on null object Can't generate and run database or start tomcat server! Change uplod directory and protect anauthorized access to files Como mostrar una imagen en una lista o en la componente detalles? Como recuperar todos los atributos de una relacion N:N y insertar registros? Conexion a Oracle 12g Connection refused. connect to Cloud Content module page variable won't assign. Convert data in a Calculated attribute Could not open the editor: This copy of WebRatio is not registered Creación DB Apache Derby - Modelado BPMN Criptare dati sensibili nel database Database connection, Host and Port number Database password encrypting Database properties Database resource consumption Database Tables Creation After Remote Deploy Data flow from a page which is not visible anymore DB in Data Service Project Deploy in Cloud Amazon Beanstalk with Postgres Dynamic data type Empty record mistakenly saved Error updating metadata process EverLasting error "The TCP/IP connection to the host has failed. Connection refused" Execute truncate sql query Export XML file analysis then update MySQL database Find Model Problemas Foriegn key relationship Generate and run locally on webratio professional edition. Get size of Multi Form with Pictures Object Array getting data from database Getting the absolute path of a RTXBLOBData Groovy and Database Groovy script numer after an error Guardar Saltos de LINEA Hide a form if condition if true How can I add a credit card payment gateway or integrate paypal in my web app logic? How can i add html into a page? How can I import a view in the Domain Model as an attribute of an Entity? how can i open a pdf file using download dialog How database or datamodel migration? How I can receive the primary key value after adding into database from OK Port. How to block empty string in Database How to calculate dates between start and end point? How to disble derby database? How to fix Network error(status 0) How to Retreive data from Multi Selection Field Array How to show certain values derived from relations in the domain model? I can't run any application with WebRatio (Table/View 'APP.POST' does not exist) Image in List field Import an XPDL 2.2 file into a BPM Project Importing JAR Libraries into Script Unit Importing jar library Insert data into database Is it possible to create a derived relationship between databases? JAR importing JDBC4 Postgresql Driver JDBC connection with mysql on mac Job not start correctly Mapping database of the entity '...' is unspecified Merge the result of 2 (or more) flows Missing units when importing project [MOBILE] Can't synchronize domain model with beck end DB [MOBILE] Script doesn't work! Modifica Entità tramite file xml Modify generated code / inject own HTML, Javascript code into existing generted code. Mostrar datos de diferentes tablas/ show dates from diferentes entities MS SQL server jdbc file multi selections field problem MySQL Driver jdbc No Apache Derby driver found No Database on Cloud account No database on my cloud account Non riesco a fare funzionare Xml out unit Passing JSON Object to Model Personalizzare lo stile di un progetto PostgreSQL Predefined values in database Problem accessing MySQL with WebRatio 6 Problema Grafo da una lista gerarchica Problema ¨HTTP Status 404" Problemas con el Operations View Delete Problem saving multi selection from input Problems to connect Sql Server DB from Webratio Problems with Database Metadata Problem with fields with accents used in attribute condition Problem with query unit! Problem with stored procedure Problem with the deletion of more than 50.000 records in a table Process model import in other languages publish web service for storing information in PostgreSQL DB following XSD Resource query a database Refresh and Synchronize DB Problems Relaciones Removing the User-Group-Module tagles Retrieve a value and add some value to it reverse engineering, problema con le relazioni di default script component Script eseguito alla User Login Script Unit e Mysql ScritpUnit and JSON data Setting Upload directory Share database connection Shuffling Script Solve "Generation Error" with Generate and Run option Standard confirm dialog replacement Statistics Component for WebRatio > 7.2.0 Status ProcessInstance and activityInstance in spanish Sybase JConnect 4 JAR replace Sync DataService Project with Mobile Project Table 'freeapp43.profesion' doesn't exist Tarea de servicio no me evalua el valor Trying to Synchronize Domain Model Unable to execute the script java.lang.NullPointerException Unknow property on Dynaclass after generation Unspecified BPM Engine Database Update mutiple records with the same value upload file and the move it to other location User Login Timestamp Username come chiave Using own User and Group tables WebRatio 6.1.2: Groovy Version / Versione Groovy Web ratio data model WebRatio - list results of joined tables Web Ratio Mobile and Foreign Key Web Ratio Mobile - Remote data mapping problem WebRatio no imports all attributes (fields) of a table Where is the ACME demo data stored?! White report