automa icon indicating copy to clipboard operation
automa copied to clipboard

repeat task make the same randomString twice

Open whwh656 opened this issue 3 years ago • 3 comments

image

---javascript block code:---- function randomString(e) {
e = e || 32; var t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678", a = t.length, n = ""; for (i = 0; i < e; i++) n += t.charAt(Math.floor(Math.random() * a)); return n } picname = randomString(6) automaNextBlock({picname}) ---javascript block code:----

randomString(6) as screensnap'name , when use repeat task block I find the first picture's randomstring name is the same as the second picture's name

whwh656 avatar Jan 29 '22 07:01 whwh656

Can you show the file name in the take screenshot block?

Kholid060 avatar Jan 30 '22 10:01 Kholid060

Can you show the file name in the take screenshot block?

I write {{dataColumns@column}}.jpeg in the take screenshot block

image

whwh656 avatar Jan 31 '22 05:01 whwh656

I write {{dataColumns@column}}.jpeg in the take screenshot block

{{dataColumns@column}} is actually a "shortcut" for {{[email protected]}}, which means it refers to the column column on the first row. That's why the screenshot file name is always the same, to fix this you can use the prevBlockData keyword to refer to the value that the javascript code block return. For example, {{ prevBlockData@picname }}

image

Kholid060 avatar Jan 31 '22 06:01 Kholid060