Flow Links App crashes on JSON datasets

Post Reply
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Flow Links App crashes on JSON datasets

Post by Padawan »

Hello Everyone,

I would like to warn everybody who is working with the new JSON datasets in Switch 2022 Spring that this will cause issues in combination with Flow Links (Version 6 and lower). You will get errors like this:
Error in line 155 of script : Undefined member function 'getPath' for object 'undefined' of type: 'Undefined'

Flow Links 6 is written in Legacy Javascript and unfortunately Legacy Javascript has no full support for JSON datasets, hence there is no quick code fix for the issue. This requires a complete rewrite using nodejs scripting. Unfortunately I don't have spare time soon to create and test a full rewrite, so it will take some time until a fixed version is available.

If you rely on Flow Links a lot, then I would advise to hold of on using JSON datasets. If you have to use JSON datasets, then you can use the following workaround:

Step 1: transfer the json info to an xml dataset
You can do this either by using JSON Pickup, a payable app from the appstore
Alternatively, you can use Data Mapper and map each of the pieces of info you require from the json to an XML dataset. This is more work, but only uses free apps.

Step 2: Remove the json dataset before it reaches a Flow Links Send element.
This can be done using the Export Metadata tool.

Once I have the time I will create a fixed version and update this thread.

A sample flow to illustrate the problem and a workaround can be downloaded here:
New flow 24.sflow.zip
(30.51 KiB) Downloaded 193 times
The flow uses the latest version of the Webhooks tool to create the JSON dataset. It can be triggered using Postman like this:
Screenshot 2022-09-05 at 13.02.08.png
Screenshot 2022-09-05 at 13.02.08.png (70.44 KiB) Viewed 4673 times
tdeschampsBluewest
Member
Posts: 34
Joined: Tue Jun 01, 2021 11:57 am

Re: Flow Links App crashes on JSON datasets

Post by tdeschampsBluewest »

Hi Padawan,
Same issue on subflow, we are looking to fix this issues in the next few weeks.

However, we have an internal app that we will release soon to work around this problem, that will transform JSON dataset to XML and vice-versa.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Flow Links App crashes on JSON datasets

Post by Padawan »

Hi Thomas,

Thanks! That might be an easier workaround for our users compared to the ones I suggested.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Flow Links App crashes on JSON datasets

Post by Padawan »

There is now a new version (v7) of flow links, rewritten in NodeJs and with support for JSON datasets.
There are also some Data Mapper functionality added.

There also is a known issue: On mac it will be slower compared to v6, if you are on Mac, do heavy processing and are tight on processing speed, then it might be worth to stay on v6 for now.

(If you are running Switch on PC, then this update will actually be a speed improvement)

There will be a future update with speed improvements, but that will use new scripting functionality which will only be available starting from Switch 2022 fall.
Post Reply