as title, how can i add data to multiple table at same time by using a!writeToDataStoreEntity, give me a example code, thank you
Discussion posts and replies are publicly visible
HI
You can write to one Data base table using a!writeToDataStoreEntity() , where as you can use a!writeToMultipleDataStoreEntities() to write data to multiple data base tables
below is an example for the a!writeToMultipleDataStoreEntities()
a!writeToMultipleDataStoreEntities( valuesToStore:{ a!entityData( entity:/* DATA STORE ENTITY*/, data:/* DATA THAT NEED TO BE STORED*/ ), a!entityData( entity:/* DATA STORE ENTITY*/, data:/* DATA THAT NEED TO BE STORED*/ ) })
Else if you are using process model then you can go with the Write to Data Store Entity Smart Service .
docs.appian.com/.../Write_to_Multiple_Data_Store_Entities_Smart_Service.html
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error [evaluation ID = e8134:373fe] : An error occurred while executing a save: Expression evaluation error: You must specify a variable to save into, such as ri!name << fn!sum. Received: Rule or Function Reference.
Please see the screenshot, where multiple entities are inside "DU Data Store" and Write to Multiple Data Store Entities should be used to write data among the entities present under "DU Data Store" .
my KONE_Development_userrole and KONE_Development_userinputsheet are all under my Data Store
if I use two buttons apply a!writetoDataEntity then both table work
Is it possible to post screenshot of your DS?
you mean both are under the same data store right? If one data store has both in it, then your a!writetomultipledatastoreentity() should work fine.
If i write independently by apply two buttons, then both work fine
As they are under same DS, it should have worked. Can you review your constant just to make sure they are using the entities from same DS and error message is still " The list of EntityData passed to the smart service contains entities from different data stores. All entities must belong to the same data store. No values have been written. (APNX-1-4208-001)".
It works! Sorry my another constant didn't create under same data Store, though they choose the same CDT. By the way, do you know how to refresh text blank to empty after click any buttons? I am so appreciate your help
Sorry i didn't create constant under same data store