I am using write record smart service, sending record fields but not primary key as it is a auto generation. when I am trying to retrieve the primary key, the primary key is not updating in the pv variable. Can anyone helps why it is happening.
Discussion posts and replies are publicly visible
Can you show the configurations you have made in the smart service's inputs and outputs?
Input:Output:
You have to save it in pv!request variable. I think you are using a field of this variable to save it. Change it to store the value directly in the variable.
when I'm saving in the pv!request then the pv variable is becoming {}.
I saved the ac!updatedRecord in pv!request then the pv became null.
Try to pass variables in error and error occurred to make sure there is no error
If you can see the data properly inserted in the database table, then have a look at source filter of the record and make sure that there is no condition which is filtering out the record that you have just written. If that condition is filtering out the record then pv in the output gets updated to null.
I tried recreating it with example below. When I wrote a record where VehicleYear was less than 2012 or null, pv in the output (i.e. pv!request in your example) was null but when I added a vehicle where VehicleYear was >2016, pv in output got updated with the inserted record along with the primary key.
Yes rishiraj has a point, and if you still want to filter your data then you can create a new security rule to define which records, viewers of that record type can see, then it will give you the expected output as well.
Hi rishi,I have checked source filters, there is no source filters given. When I'm inserting a record, it is perfectly inserting and can able to see the inserted record in the record list,However when I'm trying to retrive the primary key to store in the pv variable then it is returning null value.
Hi Sanchit, I haven't given any source filters so all records can see in the record list. However ac!updateRecord giving null vlaue.
Does the record gets updated in the DB? Does it have the PK populated?
Hi Abhay,Thanks for your comment,Yes, record is gets updated with the primary key in DB, but write records smart service output parameter which is ac!RecordsUpdated giving null instead of record field values with the primary key.
write records is working if I use Appian cloud database however it is not working same with the External DB (SQL Server).
Interesting!!! Might be a defect. Did you try reaching out to Appian support?
Not yet Abhay.