on 01-31-2022 12:26 PM
Hi all,
In the same vein as this question:
https://answers.sap.com/questions/13572142/within-script-access-widgets-dynamically.html
How would I populate a text array with the names (ID's) of widgets?
The aim being to then add the array values to a text box in an app (this bit I think I can do)
Scenario
I have 4 charts in my app: Chart_1, Chart_2, Chart_3, Chart_4
Using the code below I can write the Chart names to the console
var WIDGETS = Application.getWidgets({type:WidgetType.Chart});
console.log(WIDGETS);
The output looks like this - i'm just not sure how to extract the id value and write that to an array 😞
Any ideas much appreciated,
Thanks
Thank you SJohnson for the code!
some remarks for beginners:
1. one may rename the files to getWidgetName.js and getWidgetName.json
2. one needs to change the URL in the JSON file to "url": "/getWidgetName.js"
2. one needs to zip the files to upload them correctly (i attached a zip which I manually changed into a .txt, maybe that works ... otherwise one can copy paste the code out of the code preview from your post since i had trouble downloading your txt files)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.