I have an action set to โData: execute an action on a set of rowsโ. I can reference the row I want to edit, thatโs fine and working. I have then made another action that is called by this one in the โreferenced Actionโ drop down.
In this action I would like to use a value in the form that was just submitted (so the last row in the table) and replace a value in the row that was referenced in the initial action. They are in 2 different columns but I donโt think that makes a difference. This is all on the same table.
I can easily set the value in the column (in the row to be edited) to be changed to just a random number so I know its all working fine upto that point.
The problem comes when I try to get the value from the last row and use that. If I use [_THISROW].[Column_To_Get_Value_From] or just [Column_To_Get_Value_From], it will use the value from the row that I want to edit, not the last row (the one that trigged the action).
I have used various attempts as MAXROW(), LOOKUP(), SELECT() but canโt get anything to work. Iโm sure this should be easy, I just need to to get the value from the last (bottom) row and use that. The closest I got was to make it find the MAX value from the [Column_To_Get_Value_From] and insert that, but as the values wont be in any sort of order, it needs to be the very last row, simple as that!
Iโm sure this isnโt as hard as Iโm finding it, spent 6 hours trying to get it to work!
Any help would be great.
Rob.
Solved! Go to Solution.
Sorry, please try
ANY(SELECT(Table Name[Column_To_Get_Value_From], [Key Column of the table]=MAXROW(โAPP Fuel Truck Form โ, โ_ROWNUMBERโ)))
Hi @AviSyst_Admin
Did you try some thing like this.
Yep, It gives the following error:
The expression is valid but its result type โRefโ is not one of the expected types: Number
I also tried
MAXROW(โAPP Fuel Truck Form โ, โ_ROWNUMBERโ).[Column_To_Get_Value_From]
and I get the same error.
So I can find the row as a reference, but canโt seem to โconvertโ that to a row number or a reference I can use.
Have not properly understood all the details.
However the above could be possibly achieved by
SELECT(Table Name[Column_To_Get_Value_From], [Key Column of the table]=MAXROW(โAPP Fuel Truck Form โ, โ_ROWNUMBERโ))
But please note that this will be an inherently sync time expensive expression, especially for a table with large number of rows.
Depending on app design, you may try a dual step approach. Acolumn that calculates MAXROW() first and then using that column to get the value of [Column_To_Get_Value_From] using dereference expression.
That gave me the error:
โThe expression is valid but its result type โListโ is not one of the expected types: Numberโ
Iโve tried variations of what youโve suggested and always got this error or the previous one (โThe expression is valid but its result type โRefโ is not one of the expected types: Numberโ.
Your second suggestion is what Iโm trying to achieve but by using actions. Not sure I know how to do what your suggesting using actions?
Rob.
Sorry, please try
ANY(SELECT(Table Name[Column_To_Get_Value_From], [Key Column of the table]=MAXROW(โAPP Fuel Truck Form โ, โ_ROWNUMBERโ)))
Nailed it,
THANK YOU so much. Now Iโll go about to figure out why that works and move onwards and upwards.
Cheers,
Rob.
You are welcome. Sure,. The way you have posted earlier updates, I believe you are familiar with how all the relevant AppSheet functions work in the shared expression.
Please post back in case of any specific query.
For reference:
Thanks Steve,
Thatโs very handy to have as a reference.
Rob.
User | Count |
---|---|
43 | |
30 | |
24 | |
23 | |
13 |