[Solved] Return result depending items selected (combining variables)

The app has 3 Screens (Screen1, Screen2 and Screen3).

On the “Screen1” the user clicks on an item on a “List Viewer 1”. The item that was chosen is Updated on the Local DB “choosed” in the the cell in the column1 and rollNum 1.

On the “Screen2” the user clicks on an item on a “List Viewer 2”. The item that was chosen is Updated on the Local DB “choosed” in the the cell in the column2 and rollNum 1.

Captura de Tela 2021-03-24 às 10.13.05

On the “Screen3” the Label"s text is configured to return a result based on the itens choosed on the Screen1 and Screen2. The result is configured on a Local DB table called “final” (column1 and column2 has a combination of itens chooses on the previous Screens and column3 has the result that based on the itens choosed).

Captura de Tela 2021-03-24 às 10.08.08

I can’t return the final result simply because I can’t fill out the form of “rowNum”.

1 Like

Are you connecting to Local DB using the Data Sources method or the component method?
Depending in which one the blocks are different to get the rowNum.

I am connecting to Local DB using Data Sources.

1 Like

@muneer I am connecting to Local DB using Data Sources.

1 Like

You need to use this component to get the list of RowNums in your Local DB
image

There is a hidden column name “ID” which you need to use
image
This will give you a list of all row IDs which are 32 Alaphnumeric characters.

You will then need to loop thorough the rows to select the row that fits your criteria.

[Edit]
Check this sample project for the technique
https://x.thunkable.com/projectPage/5fb9fb1dbfeb240011084d78

@muneer It doesn’t work or I didn’t understand.

I need the text of the Label

The text of the Label is automatically filled based on a predefined result in the column3 of the following image:

Captura de Tela 2021-03-24 às 10.08.08

The result is given depending of the itens chooses of the previous Screens (the combination of itens choses in the 2 previous ItemViewer are in the image of the Local DB above).

1 Like

It would be best to share your project link so we can see the real issue.

If you feel you don’t want to share it publicly, then you can PM someone you trust to troubleshoot the problem.

Hi there,

You can use an and block from the Logic drawer of blocks to combine to if statements.

For these blocks, your first selected value and your second selected value have to match the first two columns of a given row for the app to return the third value as your result.

You can view this project here.

1 Like

Very nice work @jane
This is my version. I sent it to the user in PM
image

2 Likes

Well snap! You also accommodated the possibility that no match could be found, while my blocks do not.

@4-1-22-8-4, It looks like Muneer presented a great answer here, so I’m going to mark it as the solution for your original question. If you have further questions about how these blocks work, feel free to follow up with them here!

2 Likes