Forum Discussion
MOVC
2 years agoResolver I
Retrieve Item from Object
What's the syntax for getting something out of an Object to store in a string variable? I use a script activity to return a single value from a data warehouse: { "resultSetCount": 1, "recordsAffe...
- 2 years ago
Found it!
@activity('Get Max Mod').output.resultSets[0].rows[0].MaxModI guess the first() breaks it. Thanks for pointing me in the right direction.
ajarora
2 years agoMicrosoft Employee
Did you try `@first(activity('Get Max Mod').output.resultSets[0].rows` ?
- MOVC2 years agoResolver I
Didn't work, got the same "Can't put an Object into a string variable" error message. If I do @first(activity('Get Max Mod').output.resultSets[0].rows[0].MaxMod) then the activity succeeds but the stored value is just "1" and not the date/time I need.
- MOVC2 years agoResolver I
I switched the activity from Script to Lookup which got me what I need. I used the same query then
@activity('Get Max Mod').output.firstRow.MaxMod with the "first row only" option ticked worked. But there still should be a way to do this with Script activities.- MOVC2 years agoResolver I
Found it!
@activity('Get Max Mod').output.resultSets[0].rows[0].MaxModI guess the first() breaks it. Thanks for pointing me in the right direction.