Hello all,
I would like to duplicate few rows on the same table.
I use Appsheet for my budget management.
I have both table
Expenses
Budget
Budget have a Ref_ROWS to key Date on Expenses
Every month, i do my budget and a new date is created,
each time i imput Tags manually in table expenses.
If its possible i would like these Tags are duplicate and add new after the old with new key date.
I tried with both actions, but im not comfortable with this code.
Thanks for helping me
Herod
Solved! Go to Solution.
What do you have set as the Key for the Expenses table? I see above its the Date column but if that were the case then you'd have a duplicate key issue. Did you change it?
Also, why is Date a Ref type value?
In the Duplicate Budget Rows action you need to adjust the Date for the rows being added. Otherwise, you are adding exact duplicates and depending on how you have the key set, AppSheet will remove the duplicate row.
You will need 2 actions as described below:
1) Create an action of type "Data: add a new row to another table using values from this row". If though it states "another table" it can actually be the same table. NOTE: set the Prominence as "Do not display"
2) Create an action of type "Data: execute an action on a set of rows" that selects the rows to be duplicated and sends to the action created in #1. The expression in this action assumes that you are copying the rows once the actual date is in the new month.
3) How you set the Prominence of action in #2 will depend on how you want to activate the actions
I hope this helps!
Thanks for your help.
I done the process like you wrote, i guess.
But, when i click on the action, i see 4 adding rows, so it should be work, but
when i check on the database on google sheet, i see nothing addings
Probably the issue comes to the Prominence ? what do you think about ?
Thanks again
What do you have set as the Key for the Expenses table? I see above its the Date column but if that were the case then you'd have a duplicate key issue. Did you change it?
Also, why is Date a Ref type value?
In the Duplicate Budget Rows action you need to adjust the Date for the rows being added. Otherwise, you are adding exact duplicates and depending on how you have the key set, AppSheet will remove the duplicate row.
Yep it was my issue, i changed my key and i forgot [_THISROW] in my expression.
select(expenses[_ComputedKey],[_THISROW].[Date]=[Date])
Computedkey is key concatenate with [Date] and [ID]
Now its work Thanksssss !!!
Date is a Ref value to have connection between tables Budget and Expenses
Just a last question.
I tried to run this action on View Budget, because i want that trigger after addings a new [Date] on Budget.
But as both actions are referenced in table expenses, i cant triggered it.
I thought about to make a bot ?
Apologize for delayed response. I have been extremely busy of late.
@Herod wrote:
Just a last question.
I tried to run this action on View Budget, because i want that trigger after addings a new [Date] on Budget.
But as both actions are referenced in table expenses, i cant triggered it.
I thought about to make a bot
In the action #2 I mentioned in my prior post, set the "For a record of this table" to the table from where you wish to start the copy process. Budget in your case. Leave the Referenced Table set to Expenses.
I've got a similar challenge to this, though it is slightly different, wondering if you might be able to help with that @WillowMobileSys ?
Link to post here: https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Add-selected-values-from-a-table-Projects-to-a-...
User | Count |
---|---|
18 | |
14 | |
11 | |
7 | |
4 |