Skip to content

Commit 2309ef9

Browse files
committed
new: example for dynamic IDL image in DD
added new example how to dynamically show images from data lake in dashboard designer
1 parent 26608a0 commit 2309ef9

File tree

12 files changed

+520
-2
lines changed

12 files changed

+520
-2
lines changed

UserActivityTracker/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ This flow monitors and tracks user login activities by collecting last login tim
2828
- Update the `assetId` variable with your created asset's ID
2929
- Update the `aspectName` variable if you used a custom aspect name
3030

31-
4. Save the flow
32-
31+
4. Save the flow
3332

3433
### Additional Setup Information
3534

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
[
2+
{
3+
"id": "74088854.44f2",
4+
"type": "group",
5+
"z": "f16bdd03.e10b3",
6+
"name": "create signed URL for IDL object download",
7+
"style": {
8+
"label": true
9+
},
10+
"nodes": [
11+
"d52ee2b5.49feb",
12+
"cb726090.7ab7c",
13+
"5e9f0c82.286464",
14+
"6f572ff6.04bad8",
15+
"3283f407.651b24",
16+
"90bf7fac.d781c",
17+
"2a6e979e.87b5a",
18+
"479881fb.4ad0d",
19+
"d4323573.b3f9c",
20+
"567fd6a8.e37f98"
21+
],
22+
"x": 235,
23+
"y": 411,
24+
"w": 1190,
25+
"h": 509
26+
},
27+
{
28+
"id": "d52ee2b5.49feb",
29+
"type": "debug",
30+
"z": "f16bdd03.e10b3",
31+
"g": "74088854.44f2",
32+
"name": "",
33+
"active": true,
34+
"console": "false",
35+
"xaxis": "_time",
36+
"complete": "true",
37+
"x": 1330,
38+
"y": 780,
39+
"wires": []
40+
},
41+
{
42+
"id": "cb726090.7ab7c",
43+
"type": "debug",
44+
"z": "f16bdd03.e10b3",
45+
"g": "74088854.44f2",
46+
"name": "",
47+
"active": true,
48+
"console": "false",
49+
"xaxis": "_time",
50+
"complete": "true",
51+
"x": 590,
52+
"y": 780,
53+
"wires": []
54+
},
55+
{
56+
"id": "5e9f0c82.286464",
57+
"type": "debug",
58+
"z": "f16bdd03.e10b3",
59+
"g": "74088854.44f2",
60+
"name": "",
61+
"active": true,
62+
"console": "false",
63+
"xaxis": "_time",
64+
"complete": "false",
65+
"x": 830,
66+
"y": 780,
67+
"wires": []
68+
},
69+
{
70+
"id": "6f572ff6.04bad8",
71+
"type": "function",
72+
"z": "f16bdd03.e10b3",
73+
"g": "74088854.44f2",
74+
"name": "parse signedUrl to response",
75+
"func": "// Ensure msg.payload exists and has the expected structure\nif (msg.payload && msg.payload.objectUrls && msg.payload.objectUrls.length > 0 && msg.payload.objectUrls[0].signedUrl) {\n // Extract the signedUrl\n const signedUrl = msg.payload.objectUrls[0].signedUrl;\n\n // Create a new JSON object with the extracted signedUrl\n const newPayload = [{\n \"signedUrl\": signedUrl\n }];\n\n // Assign the new JSON object to msg.payload\n msg.payload = newPayload;\n\n // Log the output for debugging\n node.warn(\"Generated JSON payload: \" + JSON.stringify(msg.payload));\n\n} else {\n // Handle cases where the expected data structure is not found\n node.error(\"Invalid payload structure. Expected msg.payload.objectUrls[0].signedUrl\");\n // You can set msg.payload to an error object, null, or an empty object\n msg.payload = { error: \"Invalid data structure for signed URL\" };\n}\n\nreturn msg;",
76+
"outputs": 1,
77+
"language": "javascript",
78+
"noerr": 0,
79+
"x": 1120,
80+
"y": 840,
81+
"wires": [
82+
[
83+
"479881fb.4ad0d",
84+
"d52ee2b5.49feb"
85+
]
86+
]
87+
},
88+
{
89+
"id": "3283f407.651b24",
90+
"type": "function",
91+
"z": "f16bdd03.e10b3",
92+
"g": "74088854.44f2",
93+
"name": "configure file-path",
94+
"func": "\n/** NOTE:\nLeading path information \"data/ten=<yourTenantName>\" does NOT have to be included in the request. \nExample\nfull path: \"data/ten=mytenant/MyFirstFolder/MySecondFolder/my_cool_file.csv\"\n>> path: \"/MyFirstFolder/MySecondFolder/my_cool_file.csv\" for the request\n**/\n\nconst dynamicPathfromPara = msg.req.query.imgPath\n\n\nmsg.payload=\n{\n \"paths\":[\n {\"path\": dynamicPathfromPara}\n ]\n} \n\nreturn msg;\n\n\n",
95+
"outputs": 1,
96+
"language": "javascript",
97+
"noerr": 0,
98+
"x": 630,
99+
"y": 840,
100+
"wires": [
101+
[
102+
"2a6e979e.87b5a",
103+
"5e9f0c82.286464"
104+
]
105+
],
106+
"_type": "node"
107+
},
108+
{
109+
"id": "90bf7fac.d781c",
110+
"type": "http in",
111+
"z": "f16bdd03.e10b3",
112+
"g": "74088854.44f2",
113+
"name": "[GET] /dynamicImageUrl",
114+
"endpoint": "/dynamicImageUrl",
115+
"method": "get",
116+
"upload": false,
117+
"access": "key",
118+
"key": "2f27dd6dd120e513bf7443552c6922b4df95bb742b17c89ebe658d9660f1331cf094fa62e174ab4cdc6f92ba0e46c1ce8ac74553b49059167f333412090ba350",
119+
"users": "",
120+
"powerMode": false,
121+
"x": 380,
122+
"y": 840,
123+
"wires": [
124+
[
125+
"3283f407.651b24",
126+
"cb726090.7ab7c"
127+
]
128+
],
129+
"_type": "node"
130+
},
131+
{
132+
"id": "2a6e979e.87b5a",
133+
"type": "http request",
134+
"z": "f16bdd03.e10b3",
135+
"g": "74088854.44f2",
136+
"name": "generate Download URL",
137+
"method": "POST",
138+
"ret": "obj",
139+
"url": "",
140+
"timeout": "",
141+
"mindspherePath": "/api/datalake/v3/generateDownloadObjectUrls",
142+
"useMindsphereAuth": true,
143+
"isAdmin": false,
144+
"secretHeaders": "",
145+
"x": 870,
146+
"y": 840,
147+
"wires": [
148+
[
149+
"6f572ff6.04bad8"
150+
]
151+
]
152+
},
153+
{
154+
"id": "479881fb.4ad0d",
155+
"type": "http response",
156+
"z": "f16bdd03.e10b3",
157+
"g": "74088854.44f2",
158+
"name": "",
159+
"statusCode": "",
160+
"headers": {},
161+
"x": 1330,
162+
"y": 840,
163+
"wires": []
164+
},
165+
{
166+
"id": "d4323573.b3f9c",
167+
"type": "inject",
168+
"z": "f16bdd03.e10b3",
169+
"g": "74088854.44f2",
170+
"name": "",
171+
"topic": "",
172+
"payload": "",
173+
"payloadType": "date",
174+
"repeat": "",
175+
"repeatEnd": "0",
176+
"endTime": "0",
177+
"crontab": "",
178+
"offset": "0",
179+
"once": false,
180+
"properties": "",
181+
"timezone": "utc",
182+
"betweentimesunit": "m",
183+
"showNextExecution": false,
184+
"powerMode": false,
185+
"x": 420,
186+
"y": 880,
187+
"wires": [
188+
[
189+
"3283f407.651b24"
190+
]
191+
]
192+
},
193+
{
194+
"id": "567fd6a8.e37f98",
195+
"type": "comment",
196+
"z": "f16bdd03.e10b3",
197+
"g": "74088854.44f2",
198+
"name": "Signed URL with path parameter in GET request",
199+
"info": "This flow creates the signedURL for an object located in IDL. \nIt needs to get the 'imgPath' parameter via the URL. \nThis should be the full path to the object in the data lake.\n\n- Flow builds Body for IDL API call \n- POST this request to the generate Download URL endpoint\n- parses the received signedURL as output for further processing\n\nIn this example, the image is passed to Dashboard Designer for visualization. \nUsing this, you can pass an image-path variable from Dashboard Designer dynamically to this flow and then view the image in Dashboard Designer.\n\ndate: 2025-08-26",
200+
"sticky": 1,
201+
"x": 760,
202+
"y": 580,
203+
"wires": []
204+
}
205+
]
69 KB
Loading
154 KB
Loading
91 KB
Loading
38.9 KB
Loading
209 KB
Loading
202 KB
Loading
214 KB
Loading
287 KB
Loading

0 commit comments

Comments
 (0)