BLO: import instead of require

Hallo rapidM2M Community,
to connect an 3rdparty API, I got a ready steady BLO which is running prove as an Backyard in the past.
But it seems not to bei compatible to ES6 and has a problem with require(). If I autoconvert the code to ES6 module using import instead of require, there are farther issues.
Please can you help me to convert the code below?

Best regards,

I suspect that there are other functions that do not simply work here via copy paste. Is it correct that the BLO runs here in the browser and is not executed directly on the server?


First of all the new BLO’s still run on your myDatanet backend. (AppCenter → BLO Monitor)

Yes for the new BLO’s the ES6 syntax is required. As you have already figured out, you need to use import instead of require.
First add the required modules via the BLO settings

Then you can import the previous added modules:

    import async from "async";
    import _ from "underscore";

The rapidm2m-bapi is also replaced by the new ~bapi. (this library is loaded automatically)
BAPI migration and the BAPI documentation inside the studio.

To create an api client for an external api have a look at the .createClient() function.


Thanks for the information. I was now able to find and integrate the required modules.
Next, I’ll rebuild the subscriptions.
I think it should be easy to implement thanks to your documentation.

Best regards,