Tips blank

Find a specific attribute value in a single line of code!

Remember the days when you had to use nested loops and conditional statements to retrieve an object’s attribute? So you ended up with a long and complicated piece of code? Well, those days are over! Thanks to object notation combined with collections and their methods, you’re now able to write code faster, and in a more readable way!

Finding a specific attribute’s value has never been easier. Let’s take a look at a real life scenario and discover how!

Product blank

Export results of “Find in design” dialog

When you search for all objects in the Design Environment, 4D displays the results in the hierarchical list. From 4D v16 R3, you can export these results in a text file that can be opened using a spreadsheet for example, so that you can easily dispatch some refactoring work or store the results in a document to work on it later.

Product 4D Database: Search in array attribute

Search by linking array attribute query arguments

Object fields, introduced with 4D v15, allows to store and index unstructured data. This could be a common set of data, like first name, last name, birthday. It could be different data in each record, such as a shop that will need different attributes for shoes (size, color), computers (CPU, memory), printers (color, ink), a list of values or all in any combination.

Here is a real User Story from a 4D customer :

My badge application manages the access rights for each person to a building and for a time slot. This information is stored in a database as an array of objects ( e.g.: {access right, building, time slot} ). I want to be able to look for people who have access to a building during a time slot.”

4D provides several ways to query for data, using index and so extremely fast.