Hi Everyone,
In my case i have 2 record types first one is Case Summary and second record is case summary Items.
I have one to many relationship. like- the primary key of case summary have foreign key constraint from case summary items record.
Now i have to make an editable grid in which i will show all items from case summary items records but behalf of relations with case summary id . Now i am confused how can i achieve this because i have to write records at same time for summary records and case summary item records.
Means have to use a!writeRecord() in interface which will update both summary and items records with relationship.
can anyone help me on this.
Thanks in advance
Discussion posts and replies are publicly visible
I'm confused as to what you are trying to do and what you are asking. From what I can see you have a CASE_Summary and CASE_SummaryItems record with many CASE_SummaryItems for a single CASE_Summary. These are somehow displayed in an editable grid and you are wanting/needing to use the a!writeRecords() smart service to write changes made in the editable grid.
Are you asking how to complete this write to the DB with the a!writeRecords() function?
Thank you Andrew for your response.
Yes, You are right , i want some ideas how can i show that data in editable grid. because in eidtable grid i will only show caseSummary items and then i want whatever changes made in editable grid will be save in record with a!writeRecord ().
Below is the attached image where , this is a mockup image i have to show caseSummary items list as below image and on completed checkbox saveinto i will be use a!writeRecords() and need to write data in both the relationship record with one local variable.
I am able to fetch data with relationship in one local variable now in which i have summary 1 and it's 7 items.
can you give some example how can i use this in editable grid and write changes data with summary and items.
Thank you Andrew for your response,
Yes, You are right i have to show those caseSumamry items in editable grid.I have one local variable in which i am able to fetch summary and its related items. now i have to use this variable for showing items only in editible gird and write changes to writeRecords in interface.
the contain data in local varible like-
1. local!caseSummay[1 item]
idCaseSummary 1
createdBy test user,
createddate 26/02/2025
*casesummaryItems[2 items]
1. idCaseSummaryItems 1,
caseSummaryId 1
isComplete false,
2. idCaseSummaryItems 2,
isComplete true,
There are multiple ways to achieve this:
Both approaches ensure that the grid displays the updated values effectively.
Thanks for the clarification. Will only one CASE_Summary ever be displayed in the editable grid at one time? So each row in the editable grid represents the CASE_SummaryItems? I'm trying to understand if multiple case summaries need to be handled in the grid or if it's just one at a time.
Also, is the need to write to the database as soon as it's changed in the editable grid or is there a submit button somewhere?
Does your actual question boil down to "How do I write into both CASE_Summary and CASE_SummaryItems records at the same time?" or do you also need help with the editable grid? If it is just about the writing multiple records in one smart service then check out this recent answer as it has helpful info: https://community.appian.com/discussions/f/integrations/38577/how-to-store-data-in-tables-by-using-single-write-to-records-smartservice