How to access values using Scan in DynamoDB connector?
0
I'm having issues accessing the key/value pairs of the items in my DynamoDB table when using the Scan operation in the DynamoDB connector. My workflow is as below. I scan the table, then retrieve the list of items from the scan response, then go through each item in the loop to try to find the relevant key/value pairs (in this example for "Product" and "State"). However when I come to trying to access the Value information, I am unable to. Going through with the debugger I can see that the information is there when I run this microflow, and appears as "StringValue", I'm just unable to access it. Is there an easy way to access the values of the items retrieved with the Scan operation that doesn't involve re-writing parts of the DynamoDB connector module? Many thanks.
asked
Hartley Robinson
1 answers
1
Hi Hartley,
The reason you currently cannot find the $Product/StringValue attribute is because $Product is an AbstractKey object and not a KeyValueString object. You retrieve a list of all AbstractKey objects from the $ScanTableResponse object which can be any of the specialized entities of AbstractKey. To find and use the ones that are KeyValueString objects, you need to first cast them to their specialized versions. I have added an example of this in this post, I hope it helps.