I am having some trouble successfully running updateRows. I have this code:
LABKEY.Query.updateRows({
schemaName: 'study',
queryName: 'Vaccination Record',
rowDataArray: vaccRow,
successCallback: moveAlong });
where vaccRow contains all the fields/values to be updated, including ParticipantId and SequenceNum, which should be the keys for the dataset. moveAlong just goes on to the next step in the process if the update is successful. This code works fine as an insertRows, where the row doesn't exist yet, but when I run the updateRows I get an error that says: "No lsid, and no KeyManagement". Nothing gets written to the log. This is my first time using updateRows, and I'm sure I'm missing something obvious.
Tia,
Jen |
|
michael_stover responded: |
2011-04-27 10:02 |
|
|
Matthew Bellew responded: |
2011-04-27 10:36 |
we switched to 'rows' to be more consistent, but 'rowDataArray' should work as well.
I think this is cryptically trying to tell you that it can't figure out the unique key to perform the update operation.
Can you attach a screen shot of the dataset details page? |
|
jdutra responded: |
2011-04-27 10:58 |
Matthew,
Thanks for offering to help. Michael figured out what the LSID was for me, and got an example of what one looked like. Once I got the correct information in there, the update worked.
Thanks again,
Jen |
|
ymei responded: |
2012-11-19 15:51 |
I also hit this issue for updating study datasets. How to figure out the hidden LSID? Could anyone share an example?
Thanks,
Yongguo |
|
jeckels responded: |
2012-11-19 17:05 |
Hi Yongguo,
Although it's hidden in the UI by default, LSID is just one of the standard columns that's available on a dataset. There are a number of different ways to get its value. For example, you can request it by using LABKEY.Query.selectRows() and using the "columns" config property. You can use the filterArray config property to filter to the ParticipantId and SequenceNum or Date field (depending on if you have a visit-based or date-based study) so that you get only the row that you're interested in updating.
https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Query.html#.selectRows
Thanks,
Josh |
|
ymei responded: |
2012-11-21 08:46 |
Thank you, Josh! It worked out well.
Yongguo |
|
|
|