Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
5 subscribers
Views
1958 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
I am writing a one to many nested cdt (parentNestedChild) to the DB in one write
omere
over 8 years ago
I am writing a one to many nested cdt (parentNestedChild) to the DB in one write. The cdt is created with information enter on a form so no records have an identities yet. When I write the nested cdt and save the ac!StoredValues back into the pv!; the parent and child identities are saved but the foreign key field in the child cdt which maps it to the parent is still null. The values are getting written to the database, just not being saved back. Is this expected behavior?
Thanks,
OriginalPostID-215133
OriginalPostID-215133
Discussion posts and replies are publicly visible
0
Stefan Helzle
A Score Level 3
over 8 years ago
Nesting CDTs is not really recommended ... I had the same experience. Adding a script task to load the data right after the Write to DS node solved it. It looks like the DB needs a bit of time to save all relations.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
akshayan
Certified Lead Developer
over 8 years ago
I can't find the reference to the documentation, but this is expected behavior. You have to retrieve the CDT again using query rule or query entity using the id of the parent that is returned in ac!StoredValues
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sparshs
over 8 years ago
You can use a query entity in a script task after your Database node to fetch all the required data.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
omere
over 8 years ago
Thanks, I will consider querying the data vs. flattening the CDTs
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel