Hi All,
code:-
Discussion posts and replies are publicly visible
valueToStore: union(local!items, local!items)
That's the absolute fastest way it could possibly be done. Let me know if that doesn't work, we'll have to go through a more thorough way of removing duplicates.
Hi David,
Thank you for your quick response......
still, it is creating so many duplicates...
a!gridField( label: "", /* Replace the dummy data with a query, rule, or function that returns a datasubset and uses fv!pagingInfo as the paging configuration. */ data: todatasubset(local!Taglist, fv!pagingInfo ), columns: { a!gridColumn( label: "", sortField: "tagname", value: upper(fv!row.tagname), width: "AUTO" ) }, pageSize: 4, selectable: true, selectionStyle: "ROW_HIGHLIGHT", selectionValue: local!selection, selectionSaveInto: { local!selection, a!save(local!selectedEmployees, append(local!selectedEmployees, fv!selectedRows)), a!save(local!selectedEmployees,difference(local!selectedEmployees, fv!deselectedRows)) /*a!save(local!selectedEmployees,local!selectedEmployees.GroupId : ri!groupid),*/ /*updatearray(local!selectedEmployees, 1, local!selectedEmployees.GroupId = ri!groupid)*/ } ),
Please provide the another solution for this issue..
thank you
when I am clicking on the first-time create button, it is not creating any duplicates, when i am clicking on the second time it not verifying whether the record is already present or not and not to insert the already existing data.
Without fully digesting all of your code, this can occur if you are not populating the unique ID values for existing rows before writing the CDT to the DB, so Appian does not realize this should not be a re-entry (update vs insert). If there is no need to update entries, you would want to query for which values are already in the DB, and remove those from the CDT before persisting your data.
I think it would be WONDERFUL feature if Appian allowed a way to configure DB node or function to ONLY write or ONLY update, else throw error and pause the process / pink box. The fact that it's determined at runtime, even though via very explicit and predictable rules, does lead many a developer to problems like this, and adds a bunch of time for all of us to trick it into only doing what we want.
Hi Chris,
i have populated the unique id values before writing the CDT to the DB. ex;-(customerid:- 57331) if customer id already present in the DB, then no need to write that again into DB. Please provide the solution for above problem...
thank you...
How to set the multiple columns as primary key while creating the CDT...
Appian doesn't support composite primary keys I think,
So you can concat those columns in DB as a single column and make it primary.
In that situation I would deeply consider using a Stored Procedure to handle the database writes, and have IT worry about the Composite Keys and not Appian.
Is there any way that we can writr if condition on customer id and not enter repeating customerids......