Hi team,
I am looking for a way by which I can delete a data from a data store entity having some conditions.
For example, I am having a cdt having the following structure and values,
ID - Name - email
1 - Jai - jai@vijay.com
2 - vishwaas - vishwaas@nahihai.com
3 - jignesh - jai@vijay.com
Now above, id is a primary key but I want to delete the data having email as jai@vijay.com
I am not able to achieve the same using a!deleteFromDataStoreEntities smart service. Can you pls help me in writing an expression rule which can delete the two rows (1 and 3 having email as jai@vijay.com)?
Consider name of the constant for data store entity as : myDataStoreEntity
Discussion posts and replies are publicly visible
You will need to first fetch the primary key values from that table using queryEntity, and then delete the rows based on that key.
could u pls elaborate ?
What is your question? What did you try? What was the outcome? Any code snippets?
My question is rather simple, would I be able to delete the rows based on some condition (similar to Where clause in SQL) ?Is their any way by which I can write an expression rule for truncating the appian db table ? Please help in this regards.
Yes, in the way I tried to explain.
For the truncate action, I suggest to use the Query Database Smart Service. It allows you to execute SQL statement directly on the database.
but I a using the appian cloud db. Would I be able to connect ?
Yes
Could u please give an example, how can I write expression rule for the same (connecting with the appian cloud db) so that I can fire sql queries ?
You will find all the required details in the Appian documentation.
docs.appian.com/.../Query_Database_Smart_Service.html