Hi!
I have incoming array sets that get displayed in a tabulator table, where selected variables from each array (e.g. payload[0].position.units.value) make up the row. Table setup was straightforward, I simply point to (position.units.value). The one thing I couldn't figure out is how to reference values that are in a nested array such as (payload[0].take_profit.steps[0].price.value)
However, also I need to pre-process some of these variables (truncate characters, get absolute values, calculate percentages) and I can't figure out how to reference them (because it's an array). I imagine that jsonata expressions in change node would be the more elegant approach but a function (before the table) would be easier to work with if I could figure out how to reference.
Thanks!
[{"id":21299831,"version":2,"account":{"id":31430770,"type":"paper_trading","name":"Paper Account","market":"Paper trading account","link":"/accounts/31430770"},"pair":"USDT_SOL","instant":false,"status":{"type":"waiting_targets","basic_type":"waiting_targets","title":"Waiting Targets"},"leverage":{"enabled":false},"position":{"type":"buy","editable":false,"units":{"value":"7.14","editable":false},"price":{"value":"14.0","value_without_commission":"13.99","editable":false},"total":{"value":"99.9884886"},"order_type":"market","status":{"type":"finished","basic_type":"finished","title":"Finished"}},"take_profit":{"enabled":true,"steps":[{"id":88999211,"order_type":"market","editable":true,"units":{"value":"7.14"},"price":{"value":"14.7","type":"last","percent":null},"volume":"100.0","total":"104.958","trailing":{"enabled":true,"percent":"-2.0"},"status":{"type":"to_process","basic_type":"to_process","title":"Pending"},"data":{"cancelable":true,"panic_sell_available":true},"position":1}]},"stop_loss":{"enabled":true,"breakeven":false,"order_type":"market","editable":true,"price":{"value":null},"conditional":{"price":{"value":"13.58","type":"last","percent":null},"trailing":{"enabled":true,"percent":null}},"timeout":{"enabled":true,"value":2},"status":{"type":"trailing_activated","basic_type":"trailing_activated","title":"Trailing Activated"}},"reduce_funds":{"steps":[]},"market_close":{},"note":"","note_raw":null,"skip_enter_step":false,"data":{"editable":true,"current_price":{"day_change_percent":"-3.65","bid":"13.98","ask":"13.99","last":"13.99","quote_volume":"65476182.3279"},"target_price_type":"price","base_order_finished":true,"missing_funds_to_close":0,"liquidation_price":null,"average_enter_price":"14.0","average_close_price":null,"average_enter_price_without_commission":"13.99","average_close_price_without_commission":null,"panic_sell_available":true,"add_funds_available":true,"reduce_funds_available":true,"force_start_available":false,"force_process_available":true,"cancel_available":true,"finished":false,"base_position_step_finished":true,"entered_amount":"7.14","entered_total":"99.9884886","closed_amount":"0.0","closed_total":"0.0","created_at":"2022-11-16T17:25:43.419Z","updated_at":"2022-11-16T17:25:43.419Z","type":"smart_trade"},"profit":{"volume":"-0.2711058","usd":"-0.2711058","percent":"-0.27","roe":null},"margin":{"amount":null,"total":null},"is_position_not_filled":false},{"id":21299047,"version":2,"account":{"id":31430770,"type":"paper_trading","name":"Paper Account","market":"Paper trading account","link":"/accounts/31430770"},"pair":"USDT_UNI","instant":false,"status":{"type":"waiting_targets","basic_type":"waiting_targets","title":"Waiting Targets"},"leverage":{"enabled":false},"position":{"type":"buy","editable":false,"units":{"value":"16.88","editable":false},"price":{"value":"5.94","value_without_commission":"5.94","editable":false},"total":{"value":"100.3674672"},"order_type":"market","status":{"type":"finished","basic_type":"finished","title":"Finished"}},"take_profit":{"enabled":true,"steps":[{"id":88989211,"order_type":"market","editable":true,"units":{"value":"16.88"},"price":{"value":"6.22","type":"last","percent":null},"volume":"100.0","total":"104.9936","trailing":{"enabled":true,"percent":"-2.0"},"status":{"type":"to_process","basic_type":"to_process","title":"Pending"},"data":{"cancelable":true,"panic_sell_available":true},"position":1}]},"stop_loss":{"enabled":true,"breakeven":false,"order_type":"market","editable":true,"price":{"value":null},"conditional":{"price":{"value":"5.76","type":"last","percent":null},"trailing":{"enabled":true,"percent":null}},"timeout":{"enabled":true,"value":2},"status":{"type":"trailing_activated","basic_type":"trailing_activated","title":"Trailing Activated"}},"reduce_funds":{"steps":[]},"market_close":{},"note":"","note_raw":null,"skip_enter_step":false,"data":{"editable":true,"current_price":{"day_change_percent":"-7.332","bid":"5.93","ask":"5.94","last":"5.94","quote_volume":"15732336.49"},"target_price_type":"price","base_order_finished":true,"missing_funds_to_close":"16.88","liquidation_price":null,"average_enter_price":"5.94","average_close_price":null,"average_enter_price_without_commission":"5.94","average_close_price_without_commission":null,"panic_sell_available":true,"add_funds_available":true,"reduce_funds_available":true,"force_start_available":false,"force_process_available":true,"cancel_available":true,"finished":false,"base_position_step_finished":true,"entered_amount":"16.88","entered_total":"100.3674672","closed_amount":"0.0","closed_total":"0.0","created_at":"2022-11-16T16:40:59.197Z","updated_at":"2022-11-16T16:40:59.197Z","type":"smart_trade"},"profit":{"volume":"-0.3691656","usd":"-0.3691656","percent":"-0.37","roe":null},"margin":{"amount":null,"total":null},"is_position_not_filled":false},{"id":21298671,"version":2,"account":{"id":31430770,"type":"paper_trading","name":"Paper Account","market":"Paper trading account","link":"/accounts/31430770"},"pair":"USDT_ETH","instant":false,"status":{"type":"waiting_targets","basic_type":"waiting_targets","title":"Waiting Targets"},"leverage":{"enabled":false},"position":{"type":"buy","editable":false,"units":{"value":"0.08","editable":false},"price":{"value":"1197.99","value_without_commission":"1196.8","editable":false},"total":{"value":"95.839744"},"order_type":"market","status":{"type":"finished","basic_type":"finished","title":"Finished"}},"take_profit":{"enabled":true,"steps":[{"id":88984495,"order_type":"market","editable":true,"units":{"value":"0.08"},"price":{"value":"1260.44","type":"last","percent":null},"volume":"100.0","total":"100.8352","trailing":{"enabled":true,"percent":"-2.0"},"status":{"type":"to_process","basic_type":"to_process","title":"Pending"},"data":{"cancelable":true,"panic_sell_available":true},"position":1}]},"stop_loss":{"enabled":true,"breakeven":false,"order_type":"market","editable":true,"price":{"value":null},"conditional":{"price":{"value":"1178.71","type":"last","percent":null},"trailing":{"enabled":true,"percent":null}},"timeout":{"enabled":true,"value":2},"status":{"type":"trailing_activated","basic_type":"trailing_activated","title":"Trailing Activated"}},"reduce_funds":{"steps":[]},"market_close":{},"note":"","note_raw":null,"skip_enter_step":false,"data":{"editable":true,"current_price":{"day_change_percent":"-4.723","bid":"1209.13","ask":"1209.14","last":"1209.14","quote_volume":"896511658.546651"},"target_price_type":"price","base_order_finished":true,"missing_funds_to_close":"0.0","liquidation_price":null,"average_enter_price":"1197.99","average_close_price":null,"average_enter_price_without_commission":"1196.8","average_close_price_without_commission":null,"panic_sell_available":true,"add_funds_available":true,"reduce_funds_available":true,"force_start_available":false,"force_process_available":true,"cancel_available":true,"finished":false,"base_position_step_finished":true,"entered_amount":"0.08","entered_total":"95.839744","closed_amount":"0.0","closed_total":"0.0","created_at":"2022-11-16T16:21:33.776Z","updated_at":"2022-11-16T16:21:33.776Z","type":"smart_trade"},"profit":{"volume":"0.7939256","usd":"0.7939256","percent":"0.83","roe":null},"margin":{"amount":null,"total":null},"is_position_not_filled":false},{"id":21298596,"version":2,"account":{"id":31430770,"type":"paper_trading","name":"Paper Account","market":"Paper trading account","link":"/accounts/31430770"},"pair":"USDT_SOL","instant":false,"status":{"type":"waiting_targets","basic_type":"waiting_targets","title":"Waiting Targets"},"leverage":{"enabled":false},"position":{"type":"buy","editable":false,"units":{"value":"7.2","editable":false},"price":{"value":"13.92","value_without_commission":"13.91","editable":false},"total":{"value":"100.252152"},"order_type":"market","status":{"type":"finished","basic_type":"finished","title":"Finished"}},"take_profit":{"enabled":true,"steps":[{"id":88983383,"order_type":"market","editable":true,"units":{"value":"7.2"},"price":{"value":"14.58","type":"last","percent":null},"volume":"100.0","total":"104.976","trailing":{"enabled":true,"percent":"-2.0"},"status":{"type":"to_process","basic_type":"to_process","title":"Pending"},"data":{"cancelable":true,"panic_sell_available":true},"position":1}]},"stop_loss":{"enabled":true,"breakeven":false,"order_type":"market","editable":true,"price":{"value":null},"conditional":{"price":{"value":"13.56","type":"last","percent":null},"trailing":{"enabled":true,"percent":null}},"timeout":{"enabled":true,"value":2},"status":{"type":"trailing_activated","basic_type":"trailing_activated","title":"Trailing Activated"}},"reduce_funds":{"steps":[]},"market_close":{},"note":"","note_raw":null,"skip_enter_step":false,"data":{"editable":true,"current_price":{"day_change_percent":"-3.65","bid":"13.98","ask":"13.99","last":"13.99","quote_volume":"65476182.3279"},"target_price_type":"price","base_order_finished":true,"missing_funds_to_close":0,"liquidation_price":null,"average_enter_price":"13.92","average_close_price":null,"average_enter_price_without_commission":"13.91","average_close_price_without_commission":null,"panic_sell_available":true,"add_funds_available":true,"reduce_funds_available":true,"force_start_available":false,"force_process_available":true,"cancel_available":true,"finished":false,"base_position_step_finished":true,"entered_amount":"7.2","entered_total":"100.252152","closed_amount":"0.0","closed_total":"0.0","created_at":"2022-11-16T16:16:49.795Z","updated_at":"2022-11-16T16:16:49.795Z","type":"smart_trade"},"profit":{"volume":"0.303192","usd":"0.303192","percent":"0.3","roe":null},"margin":{"amount":null,"total":null},"is_position_not_filled":false}]