Home > Forum > Rules, JS, SQL > Reading data from a dictionary

Reading data from a dictionary
0

What is the possible and if, the most efficient way of getting data from a dictionary into a js file that is supposed to read all the items from said report ? SQL(business rule, then convey it to the js file as an argument) or we can natively do it in js ?

MVP

Hi,

I get the impression that you know what your way with JavaScript.

If you bring up the network tab of the developer tools you can see the "internal API call" WEBCON BPS is using to retrieve the data of a report.

You can do the same from JS. The "issue" is that the integer values will change per environment.
As long as you are executing the JS from a form, you can store this information using an HTML field. Within a script tag you can assign the integer values to variables. You can retrieve this integer values with business rules to which you pass the GUID of the report/view.

I haven't used this approach but I needed to get the integer id of a business rule. :)

Best regards,
Daniel

MVP
In reply to: Arthuzad

interesting approach, would need to look into it deeper. is there any guide or docs that you can point me to, where some similar work is done there ?

Hi,

I don't think you will find some official documentation on how to use the internal APIs like fetching data from a report.

I also haven't used it, but if you need an example for the other elements I mentioned you could look at this post:

There's a business rule to retrieve the integer id of a business rule/parameter by passing the GUID.
https://daniels-notes.de/posts/2024/start-teams-chat-from-user-fields#business-rule-integer-ids

The result is assigned to a JavaScript variable which is defined inside the script element in an HTML field.
https://daniels-notes.de/posts/2024/start-teams-chat-from-user-fields#configuration-html-field


Best regards,
Daniel