Example JSON Input file retrieves e.g.: carparks/2/payment_methods as 3 entries:
But if I don't know how many entries it has, is it still possible to do the same thing with JSON Input TOP and get back string array attribute?
E.g: this does not work (error):
Error:
setStringAttrib(): incompatible function arguments. The following argument types are supported: 1. (self: _pdg.WorkItem, name: unicode, value: unicode, index: int=0L) -> None 2. (self: _pdg.WorkItem, arg0: unicode, arg1: UT_Array[unicode]) -> None Invoked with: <GenericData name='jsoninput130_6', id=745 at 0x00000000b69b9e00>, u'payment_methods', [u'Bills', u'Coins', u'Charge (Visa / Mastercard / American Express Only)'], 0 Error running Python callback 'onGenerate': Traceback (most recent call last): File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.391/houdini/pdg/types\utils\jsondata.py", line 179, in onGenerate processOpForFile(result.path, upstream_item, op) File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.391/houdini/pdg/types\utils\jsondata.py", line 159, in processOpForFile self.arrayRetrieve(item_holder, upstream_item, file_in) File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.391/houdini/pdg/types\utils\jsondata.py", line 279, in arrayRetrieve self._dive(item_holder, upstream_item, field, splitarray, query, json_data) File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.391/houdini/pdg/types\utils\jsondata.py", line 373, in _dive self._addAttrToItem(nitem, json_data, field, attr_index) File "C:/PROGRA~1/SIDEEF~1/HOUDIN~1.391/houdini/pdg/types\utils\jsondata.py", line 392, in _addAttrToItem nitem.setStringAttrib(attributename, obj[field], attr_index) TypeError: setStringAttrib(): incompatible function arguments. The following argument types are supported: 1. (self: _pdg.WorkItem, name: unicode, value: unicode, index: int=0L) -> None 2. (self: _pdg.WorkItem, arg0: unicode, arg1: UT_Array[unicode]) -> None Invoked with: <GenericData name='jsoninput130_6', id=745 at 0x00000000b69b9e00>, u'payment_methods', [u'Bills', u'Coins', u'Charge (Visa / Mastercard / American Express Only)'], 0
(My current workaround is Python Script TOP)