How to access data from a stuructue

How to access data from a stuructue

  

I need to retrieve data from a structure where i stored the sorted result from a query. I need get that value to print in between a sentence

Hi Charles,

Can you give a better example of you are trying to accomplish?

Kind regards,

Remco Dekkinga

OK. I have a room booking form where i have to find out the from the information from the form about the cheapest room available for  with the given requirement. For example  have to print room 101 @ $20 per night. I have an sql query to sort out the rooms and i created a structure to receive the results. How do I access information from this structure to return the room detail. (This is the final exercise in the Web Development training session)

Hi Charles,

If your query returns just one row, you can use an expression with something similar to the following content:

"room " + getQueryResults.list.current.roominfo.roomnumber + " @ " + getQueryResults.list.current.roominfo.price + " per night"

Make sure that you change the naming to the one you use in your query.

If you have multiple rows in your query and you only want to show one, order the query in a way that the row you want to show is the top 1. By the way, you can then also add a TOP 1, which returns just one row and you are back to my first answer.

If you have multiple rows and you want to show multiple lines, add the expression to a RecordList.

Kind regards,

Remco Dekkinga

How to assign the values to the structure. I assigned the output structure and i cannot access it to retrieve data from it

I hope you are using structure in Advance Query.

double click on the expression. In preparation section or local section, you will find your query. Expand the advance query to reach to the structure and its attributes.