Functions related to export and delete

enq
Bronze 1
Bronze 1

Hello AppSheet Community,

As a newcomer to AppSheet, I have encountered two issues and would appreciate some guidance.

Issue 1: Integrating Export and Delete Functionality in a View

I have created a filtered slice called "received_and_checked". Additionally, I've established a view named "export update" linked to the "received_and_checked" slice.
Now, I want to add a feature combining export and delete actions. Specifically, I want to be able to export data and then promptly delete the exported records. Could you please provide detailed steps on how to achieve this?
(Deletion Note: Delete the data that was just exported)

slice table
ๆˆชๅœ– 2023-12-25 ไธŠๅˆ11.47.53.png
export update view
ๆˆชๅœ– 2023-12-25 ไธŠๅˆ11.51.11.png

Issue 2: Understanding Rules for Displaying Actions in Views

I've been attempting to create various actions, but I'm unclear about the rules governing which actions appear on a view. Some actions are visible on the main page, while others only appear in the detail view, making it challenging to perform uniform actions across the entire page.

Here are two examples:
I want the ability to delete all data in a view.
ๆˆชๅœ– 2023-12-25 ไธŠๅˆ11.48.52.png

I aim to integrate the export functionality, but these actions do not appear on the view.
ๆˆชๅœ– 2023-12-25 ไธŠๅˆ11.49.04.png

Please provide recommendations or insights into how actions are displayed in views. I appreciate any advice or suggestions you can offer.

Thank you,
Enqvist

Solved Solved
0 17 467
1 ACCEPTED SOLUTION


@enq wrote:

In the (slice)received_and_checked - (view)export update, I've filtered out data without issues (using the property field).
The goal is to export this data to update the source system, modify the status of those items, and then delete the exported data since it is no longer needed in the All


Thank you for the fresh details. I appreciate. I already seem to have shared the approach to achieve the above. 

Since you already have the filtered data in the slice "received_and_checked", you could use the CSV export through the bot automation approach I have already mentioned in detail before. Please refer that post. It has clearly described all the steps.

Suvrutt_Gurjar_0-1703575619205.png

For deleting the records also , I have clearly described the steps in the post earlier.

Any specific reason you are not able to use that approach?

 

View solution in original post

17 REPLIES 17


@enq wrote:

Issue 2: Understanding Rules for Displaying Actions in Views


Certain actions such as edit, delete and making changes to the columns in a row are essentially row level actions. So you can add them in detail view as prominent or primary actions. However in the summary views such as deck, table views you cannot have them as primary or prominent level actions for the obvious reason that those are row level actions. You can display these actions as inline actions attached to each row in summary views. Alternatively you can have the option of "bulk" actions to invoke row level actions on multiple rows in a summary view.

Actions: The Essentials - AppSheet Help

Use bulk actions - AppSheet Help

In summary views, you could have non row level actions such as CSV Upload , download or row add actions as primary position actions.


@enq wrote:

Issue 1: Integrating Export and Delete Functionality in a View


Your this requirement is not exactly clear. Where would you like to export the records? 

In general you could use bot automation to do that in a bit easier manner. The bot can have two steps, Step1 : Export ( actually copy) records to another table and then delete records from the original table. To do this with actions to copy multiple rows from one table to another, you will need to use tips such as below.

Search - Google Cloud Community

 

 

 

 

Hi

Thank you very much for your prompt response and the valuable information. I'm currently going through the AppSheet Help resources.

Regarding your queries ,

1. Exporting records to a CSV format for integration with another system.
2. Step 1 - Export (copy) records to another table and then delete records from the original table. I'm interested in learning more about using bot automation to achieve this. Could you guide me on where I can learn to implement bot automation for these actions?
Your assistance is greatly appreciated.

Enqvist

Please refer the help articles below on bot automation. There are various other help articles linked in the article mentioned below

AppSheet automation: The Essentials - AppSheet Help

Edit: For your requirement, you could have the step 1 of the bot that exports the records of a table as a CSV, with a .txt CSV template

Suvrutt_Gurjar_4-1703493963351.png

The bot step settings for the CSV export step could be something like below

Suvrutt_Gurjar_0-1703493488211.png

The .txt template for CSV export could look like below. For multiple records, you would need <<START>> expressions.

Use Start expressions in templates - AppSheet Help

Suvrutt_Gurjar_1-1703493615856.png

The second delete step could call a webhook and could look like below

Introduction to webhooks - AppSheet Help

Suvrutt_Gurjar_2-1703493777833.png

The delete HTTP request body could look like below

Suvrutt_Gurjar_3-1703493839353.png

You would of course need modifications to the <<START>> expression to select only the desired records with a suitable SELECT() based expression or using a slice based expression,

 

 

 

Hello,

Thank you for providing the information. I'd like to offer as much detail as possible. Here's the configuration of data and views in AppSheet:

"list" (slice) linked to "list" (view).
"Received and check_ok" (slice) linked to "export update" (view).
"wrong cards" (slice) linked to "issues" (view).
ๆˆชๅœ– 2023-12-26 ไธŠๅˆ10.36.58.pngๆˆชๅœ– 2023-12-26 ไธŠๅˆ10.37.13.png

I aim to achieve the following effects:

1. In the "list" view, users can review information and distinguish between correct and incorrect entries (this part has been confirmed without issues).
2. In the "export update" view, export correct information to a CSV file and simultaneously delete the exported data.
3. In the "issues" view, move incorrect information to "wrong data" and then delete the moved data.

The challenges I'm facing are primarily in points 2 and 3.

As shown in the image below, I'm using a filter to select information based on the unique ID field. I want to export and delete all filtered information automatically. However, I'm struggling to integrate this concept, and currently, only one export action is set up on the interface. Ideally, the export should automatically trigger the deletion.
ๆˆชๅœ– 2023-12-26 ไธŠๅˆ10.38.03.png

My current approach:

I created an action "A": (Grouped) execute a sequence of actions, which performs export and delete sequentially.
Expected behavior: Clicking action A in the "export update" view should export and then delete. However, action A is not appearing in the view or detail.


The issue is similar in the "issues" view.
I set up an action "B": (Data) add a new row to another using values from this row. Similarly, I created action "C" (Grouped) execute a sequence of actions, which performs action "B" and delete sequentially. However, it is worth noting that while Action "B" is visible in detail and can be executed individually,Action "C" does not appear in the view.
ๆˆชๅœ– 2023-12-26 ไธŠๅˆ10.38.27.png

Could you please suggest directions for research or adjustments? Thank you.

Enqvist

Thank you for the details. However your configuration is not exactly clear, especially with actions and other operations.  If you have different views ( List, Export Update and Issues) on the same table, then not sure why you need "Add a new row ..." type action.  Could you elaborate? 


@enq wrote:

I aim to achieve the following effects:

1. In the "list" view, users can review information and distinguish between correct and incorrect entries (this part has been confirmed without issues).
2. In the "export update" view, export correct information to a CSV file and simultaneously delete the exported data.
3. In the "issues" view, move incorrect information to "wrong data" and then delete the moved data.


This is not exactly clear. Could you elaborate? What you mean by "move" the data. Is it correct understanding that by "move" you mean changing some status column in a record, so that the record gets selected in different slices and views depending on the value of that status column?

As a side note, it may be a good practice to not use names such as "List" , "Card" etc, in naming elements in the app, because AppShet also has function by the name LIST() and there is a "Card" view in AppSheet.  Sometimes it can be confusing, when one is constructing an expression  based on the same function. If necessary, you could use such conflicting names in "Display Name" property of the element. Below is the list of AppSheet functions

AppSheet function list - AppSheet Help

 

 

Thank you for your inquiry and suggested modifications.

Regarding the question of "why you need 'Add a new row...,'" my primary objective is to transfer data from the "view" (issues) to "wrong data" (data) for additional management and record-keeping.

The complete explanation is as follows:
I intend to copy and write data from the checked and confirmed-as-wrong "view" (issues) into "data" under "wrong data." After the writing process, the original data in the "view" named "issues" becomes unimportant and can be deleted.

The main reason for doing this is the concern that subsequent data, not yet recorded as errors, may overwrite fields recorded in AppSheet.


@enq wrote:

The main reason for doing this is the concern that subsequent data, not yet recorded as errors, may overwrite fields recorded in AppSheet.


Could you elaborate this statement? Why the concern is there of data getting overwritten? Typically with good database design, this is unlikely to happen. 


@enq wrote:

Regarding the question of "why you need 'Add a new row...,'" my primary objective is to transfer data from the "view" (issues) to "wrong data" (data) for additional management and record-keeping.


This is a bit confusing. If you wish copy to data from one table to another, then where CSV comes in the picture. Original discussion started with CSV export. Copying data from one table in the app to another app table is different from exporting it to CSV.

In general, I may say that what you are looking for should be possible. However a minute step by step approach for this extensive requirement may not be possible in the community platform. This may entail taking a look at the app which is beyond the scope of the community. The community can of course suggest some approach or a specific expression, that you may  need to further build on.

You may still want to restate your requirement more clearly and the community could try to assist.

 

 

Thank you for your patient response.

Within this app, I intend to use it for inspecting received items, sourced from another system with items in a certain status.

I've created a "Date: All list" to store the source data.
The actions of receiving and inspecting are performed in the (slice)list - (view)list section.
The details of receiving and inspecting are recorded separately in new fields, property1 and property2.
It's worth noting that the source data doesn't have a property field.

In the (slice)received_and_checked - (view)export update, I've filtered out data without issues (using the property field).
The goal is to export this data to update the source system, modify the status of those items, and then delete the exported data since it is no longer needed in the All list.

This leads to the first requirement I mentioned: I want the data to be deleted after exporting it as CSV.

In the (slice)wrong cards - (view)issues, I again use the property field to filter out problematic data.
These problematic items require additional manual processing.
Because the status of problematic data in the source system cannot be modified, the next set of source data will have the same items. Importing this data into the All list would replace the property field with blanks, making it impossible to differentiate records without the property field.

Hence, I need to move problematic data to another data set for management and manual processing.

Returning to the second requirement, I hope to write problematic data into another data set and then delete it.

Finally, I'd like to add that my process might not be perfect, and I'm still contemplating how to plan the entire workflow. As a first-time AppSheet user, I need some time to explore, but I'm very grateful for your assistance.

In my opinion, the action Data: execute an action on a set of rows is not a row action and should allow me to put a Display as primary button in Table views.

It is similar to what happens with Add: it is not associated with the current row.

The developers of AppSheet do not think the same.

Thank you @JSO for your opinion. I agree with you. However,  I think the actual implementation pane of this action setting is currently suited for "reference" rows, meaning related rows in another table. So the original intention of this action seems to be for related rows to a specific row in initiating table from where the action is invoked.

However it is true that it works on any group of records( even non related) mentioned in the "referenced rows" setting. This seems to be unintended "good" option available with that action.

So Appsheet team could either introduce a totally different action to delete even non referenced or non related rows or they could suitably change the setting titles in the action.

It will be interesting to know opinion of other colleagues. 

 

In the case of having to process several records based on a condition (it happens to me in an application), I have chosen to put the action within the detail view of them (I can't think of anything better from a visualization of data).
That is as incoherent or more than doing it from a view with the entire complete table.

Yes, I agree that it makes a good case to show the action in summary views.


@enq wrote:

In the (slice)received_and_checked - (view)export update, I've filtered out data without issues (using the property field).
The goal is to export this data to update the source system, modify the status of those items, and then delete the exported data since it is no longer needed in the All


Thank you for the fresh details. I appreciate. I already seem to have shared the approach to achieve the above. 

Since you already have the filtered data in the slice "received_and_checked", you could use the CSV export through the bot automation approach I have already mentioned in detail before. Please refer that post. It has clearly described all the steps.

Suvrutt_Gurjar_0-1703575619205.png

For deleting the records also , I have clearly described the steps in the post earlier.

Any specific reason you are not able to use that approach?

 

The configuration for automation seems to be stuck at the "configure event," and I'm unsure how to set "export" as a trigger event.

As shown in the screenshot, I would like to use the "export" action from the (view) export update as an event.
่งธ็™ผ.png

Also, do you know if I am mistaken in my approach? Is it not possible to use "export" as an event?

To trigger the export through user initiated action, you can use the approach described under the section Send an email from an Action button"

The help article described how to trigger an email automation but you can use that approach for triggering other automations as well. 

Example automations - AppSheet Help

At this point, please note that the suggestions are based on whatever inputs you are sharing in the posts. Please do evaluate all suggestions at your end for your long term use. The community suggests based only on shared data and you will need to evaluate it considering your entire app design. The community cannot know the entire app design or goals. 

Thank you for your assistance. Since I haven't fully grasped the details, I am unable to resolve the issue at the moment. However, But I will try to review the relevant AppSheet documentation, narrow down and differentiate the issues, and see if I can find a solution. Thanks again for your help.

You are welcome. I believe what you are looking for is doable with AppSheet automation. However, yes, you may need to familiarize yourself with various components of automation and then it should be easier for you.

Best luck.

Edit: You could also do the needful in two steps. For exaporting the data as CSV you could simply use the CSV export action as shown below. That action will work on records of any summary view.

Suvrutt_Gurjar_0-1703580592351.png

Once the records are exported to a CSV file, you could separately perform the delete operation using bot. If you have simply 10-20 records to be deleted each time, you could also use bulk action option.

This could be a simpler approach for now rather than using the bot automation.

 

Top Labels in this Space