Hello,
I have a table called FleetRequest where our employees go in and request a vehicle to use temporarily or permanently. Then there is a table called VehicleAsset that holds all of the vehicles we have in stock. I set it up where from the request there is a dropdown that references VehicleAsset and displays the vehicles that are currently unassigned. You can then save that vehicle to that request and mark it completed.
I wanted to make an action that passes on the driver name from the request over to the asset table.
FleetRequest[employee_name] -> VehicleAsset[assigned_driver]
VehicleAsset[vehicle_status] = โ4โ
Status 4 is a referenced table that equals โAssignedโ.
I made an action:
I used: ANY(FleetRequest[employee_name])
because it gave me an error if I used: FleetRequest[employee_name]
โThe expression is valid but its result type โListโ is not one of the expected types: Refโ
I then tried to make a WorkFlow, which is where I found my issue.
I canโt add the action I made because it is from another table.
Of course, any help with this would be much appreciated. I am truly grateful for this community. You guys have helped me with multiple things thus far.
So thank you.
Solved! Go to Solution.
My [requested vehicle] was just an example column name. Looks like you should use [vin_number] in its place, assuming that is a Ref type column pointing to the VehicleAsset table (or a slice of that table).
Youโll need to utilize the Action type โExecute an action on a set of rowsโ to trigger your action from the origin table.
Okay cool, thanks. I will look at this now. I had issues narrowing down how to search for it lol
Yea I kinda went down this road earlier today. This is what I made, that didnโt work.
I made a new action like the one you mentioned, but I could not figure out what to put in the Referenced Rows section.
I figured maybe adding [employee_name] but got this:
I need to change both:
VehicleAsset[assigned_driver]
VehicleAsset[vehicle_status]
So what am I putting there?
In the app example I looked at earlier this morning, it put [Children] in there but I am not trying to change a referenced row. If that makes sense.
App Example:
https://www.appsheet.com/samples/This-app-shows-how-to-use-reference-actions?appGuidString=e76d2e73-...
Disclaimer, Iโm only skimming your posts and not examining in huge detail.
Youโre selecting a vehicle in the request table, thatโs a Ref column, pointing to vehicles table, is it not? Thatโs what you use for the Referenced Rows field, but you have to put it inside of a LIST() as well. So:
LIST( [requested vehicle] )
Not sure I follow completely.
Yes. The FleetRequest[vin_num] column references a slice from VehicleAsset that displays โUnassignedโ vehicles to choose from.
Once one is picked and they click save, I want to change 2 values for the vehicle associated to that VIN on the VehicleAsset table.
Not sure where [requested vehicle] is coming from.
My [requested vehicle] was just an example column name. Looks like you should use [vin_number] in its place, assuming that is a Ref type column pointing to the VehicleAsset table (or a slice of that table).
That worked. But as always, you fix one thing and thereโs another issue that pops up. I think being a developer and having the mind of a developer, can cause issues when trying to use AppSheet; since itโs made for non-developers lol
It passes along the changes properly based on the vin, but it has an error when trying to pass along the employee name to then become the assigned driver.
Youโll need to choose the most recent value. I would combine a MAXROW() expression to get the key value from the row with the highest rownumber, then use it in a LOOKUP() expressions to get the employee name. Something like:
LOOKUP(
MAXROW( request[name] , โ_rownumberโ , [requested vehicle] = [_THISROW] ),
โrequestโ,
โkey columnโ,
โemployeeโ
)
With a little finesse this morning
LOOKUP(
MAXROW(
โFleetRequestโ, โ_ROWNUMBERโ, [vin_num] = [_THISROW]),
โFleetRequestโ, โuuidโ, โemployee_nameโ
)
That worked.
I appreciate ya @Marc_Dillon
User | Count |
---|---|
33 | |
11 | |
3 | |
2 | |
2 |