Hi,
I have a vehicle collection with a list of reports (one-to-many relationship). I’d like to link from the individual report to the vehicle details view. The link in itself is not the problem, but how can I attach the data to the link action which is referenced in the report?
One workaround which came to my mind, is using a list component with a filter which only shows one element, however this requires a unique filter field/column which (apart from user email) is not possible in Adalo as far as I know. (technically the license plate and VIN should be unique, but I can’t prevent a vehicle to be created twice since there is no duplicate checking except for the user collection).
Also the list approach takes an additional second to load the data which is not ideal.
Maybe I wasn’t clear enough in my explanation. I have a list of reports (of all vehicles), each report belongs to one vehicle. When you click on one list item (report) it opens the report’s details page. from there I want to link to the vehicle’s details page (the vehicle being a one-to-many relationship with reports, thereby there is a single vehicle reference in each report).
It should be quite easy to append the referenced vehicle to the link and open the details page of the vehicle, however I can’t find a functionality to do so.
The only thing I could come up with, is a list of vehicles with a filter, where report->vehicle->vin equals vehicles->vin and limit the result count to one. However, there is no way for me, to prevent two vehicles with the same VIN to be created. (say, the user is too lazy and enters “1” in the vehicle VIN for several vehicles, this would mess up that approach).
If you already have a vehicle detail page, go to it and click on the page. Then go to where it says “available data” That is what the page is looking for data wise.
Then go to your reports page and the button you are using to send the user to that vehicle page the link should show the data its sending, those two need to match.
If they dont match a work around for this would be to duplicate that vehicle page and remove the link that was the wrong data type and then your new link should be the data type its looking for. You may have to tweak other components on the page because everything is now getting that new data type.
thanks for your response @dilon_perera ! much appreciated!
yes, exactly like that! And I think I have solved it exactly like you did with a list of vehicles inside the report details page which is filtered by the vehicle name of the report’s vehicle. However, what happens, if you have 2 vehicles with the same name? then either both would be shown in the list, or if you set a maximum number of 1 items, only one. But either way, you can’t be sure, its the right one!