Good Morning Guys,
How would one create an action to insert a row into a table.
I have a Table view that has quick edits enabled and have the ability to add, edit, and delete rows.
Problem is, if there is a row that needs to be inserted 5 down, currantly the user needs to delete everything up and too the 5th row, and redo the rest. Looking for a way to select a row and insert row above/below.
Any help would be appreciated
Thanks,
Solved! Go to Solution.
(max(rows[sequence]) + 1)
([sequence] + 1)
orderby(
filter(
"rows",
([_thisrow].[sequence] = [sequence])
),
[_rownumber],
true
)
(
orderby(
filter(
"rows",
([_thisrow].[sequence] = [sequence])
),
[_rownumber],
true
)
- list([_thisrow])
)
top(
orderby(
filter(
"rows",
(([_thisrow].[sequence] + 1) = [sequence])
),
[_rownumber],
true
),
1
)
isnotblank(
filter(
"rows",
([_thisrow].[sequence] = [sequence])
)
- list([_thisrow])
)
linktoform(
"rows_Form",
"sequence",
(
any(
sort(
select(
rows[sequence],
([sequence] < [_thisrow].[sequence])
),
true
)
+ list([sequence] - 1)
)
+ 1
)
)
Provided Iโve understood you correctly, Iโm afraid thatโs not possible @Jonathan_S
Is there a way to see what rows the user has selected? and how many?
I could just copy all rows to temp table add a new row, and re add all the rows, but would need a way to see what row the user has select.
I would only show the action insert above/below if the user has select only 1 row.
@Jonathan_S
Thereโs no way to insert data in between table rows with AppSheet. The recorded data is always added after the last data row. So you canโt provide that with AppSheet itself. It might be possible with Google Apps Scripting and via webhook workflow. But this will have the cons that the data will not be immediately seen in the app, the app will needed to by synced. With multiple users, this option might cause some mess provided they havenโt synced their apps lately and try to do this operation which might result with unwanted data flow and mess.
Do you think it would be possible, as a row level action, that all rows after the row in question are deleted? and than add the new row, and re add those rows after?
It would never be more than 25 rows or so.
Havenโt tried but I believe it might be doable with some sequential actions, dataChange workflow, or even with preset AppSheet API.
Add a sequence column to the table, allow the user to set the value, then sort by sequence number?
@Steve,
@Jonathan_S wishes to insert data the recorded data in the gSheet back-end between rows
No to much thinking on the users end.
Anyone else ever done this? The way Im thinking will create about 75 Sync Items
And than if the user cancels the form because they decide they dont want to than what?
(max(rows[sequence]) + 1)
([sequence] + 1)
orderby(
filter(
"rows",
([_thisrow].[sequence] = [sequence])
),
[_rownumber],
true
)
(
orderby(
filter(
"rows",
([_thisrow].[sequence] = [sequence])
),
[_rownumber],
true
)
- list([_thisrow])
)
top(
orderby(
filter(
"rows",
(([_thisrow].[sequence] + 1) = [sequence])
),
[_rownumber],
true
),
1
)
isnotblank(
filter(
"rows",
([_thisrow].[sequence] = [sequence])
)
- list([_thisrow])
)
linktoform(
"rows_Form",
"sequence",
(
any(
sort(
select(
rows[sequence],
([sequence] < [_thisrow].[sequence])
),
true
)
+ list([sequence] - 1)
)
+ 1
)
)
Unbelievable @Steve
Give me some time to work through all this
Unbelievable
User | Count |
---|---|
15 | |
11 | |
10 | |
8 | |
3 |