Hello Everyone,
There is an issue in Write Records Smart Service
Its not giving as output with/of primary keys in the Output section
It works for a record which takes single value as input but not working for array pv!
Please ping if anyone has faced this issue before, We,ve tried everything but nothing is working
Thanks in advance.
Discussion posts and replies are publicly visible
I am experiencing the same situation. I am on cloud version 24.1 and the latest version of the smart service Write Records (Write Records and Related Records (internal3.write_records_to_source_23r3)) is not returning primary key in AC!RecordsUpdated, even though new row is inserted into database. Firstly, I thought I am going crazy, but then I copied old version of this smart service (Write Records 23.2) from old process model and it works without problems. If it's a global problem on all 24.1 environments then it am surprised it is not giving problems to more people.
Is anybody else able to simulate latest Write Records smart service on their 24.1 environment to see if they get the primary key back or not?
Appian Cloud Version: 24.1.460.0
Yes, the behavior of this node has changed. I described this in my blog post.
But not returning any PK ?!?! This might be a stupid question, but could it be that you have a misconfiguration in the node? E.g. a conflicting assignment in inputs -> saveInto vs. an assignment in outputs, both writing to the same PV.
Sure, I am aware of a different behaviour between these 2 versions but indeed the problem is I just simply cannot get the PK out of this Write records node.
I don't think any misconfiguration is happening here but you can double check screenshots.
I also tried writing into other record type to rule out problem with just specific record type. The same result, no PK returned in AC!RecordsUpdated.
Are you able to create simple PM with just Write Records smart service whether it works for you on 24.1 version?
Hm .. I do not see any obvious mistake. As my environment already is on 24.2, I cannot really help you with this.
Do you see any errors in the tomcat log or in the error outputs?
I realized our YourFlow environment is still on 24.1, so I tried and I see the same behaviour. No PK returned in the output. I think I will create Appian support ticket and I will see what they have to say.
I see that you have used construct expression rule to form the record type structure. Can you remove the Primary key field from the expression rule and then try running write to records smart service.
Actually you are right. This seems to be the root cause.
However, I still think this is a bug because documentation says there should be no difference between PK column being omitted or set as null.
yes, seems to be a bug.
Any chance you're on SQL Server? If so, I believe this is a known issue: community.appian.com/.../kb-2299-write-records-smart-service-fails-when-writing-record-with-null-primary-key-to-sql-server
I support Juraj Buc in when the documentation says "omit OR set to NULL", that setting it to NULL will work as expected.
Thanks for the heads-up, Peter Lewis, but this looks like a different issue.
1. it occurred on MariaDB (Appian Cloud Database)
2. Write Records node is actually successfully executed and it writes new row into the database, it just doesn't return new generated PK in the Outputs
This was a bug actually and it was corrected in 24.2. Meanwhile you can avoid the issue by leaving the PK field off your variable instead of including it with a NULL value. Write Records will still create the PK of course and include it in the output. Sorry for any inconvenience caused by the issue!