TechVentury
Member
I want to achieve to randomly select a single file in a specific folder on GDrive.
I have issues with multiple problems, here and would kindly ask for hep from the pros on the group.
Problem 1 - knowing how many files are in the folder: When I look at the response that comes back from "Google Drive List Folder Content" command, I do not identify a key that holds the value of the amount of files inside the folder. If that doesn't exist, I guess we have to "count" the files somehow. I tried the iterator, but it needs an array as json and the GDrive responds is not shown as an array. What can I do here? Is there a way to convert the entire GDrive response into an array? Are there other ways to iterate through GDrive files or some other way to count them? Is there a way how to find the highest number seen in any "key"(not "value")?
Next I have to generate a random number between 1 and the prior-step-result-number. This seems easy with RANDBETWEEN(1, [prior-step-result-number]). No need for help.
Problem 2 - selecting the final result: Now, I got the random number and want to use that particular file in the next step of my flow. It is not clear to me how to map that file. As GDrive list response does not give me a key/value pair for a certain file count I need to select the file through it's name or Id, but the number I am looking for is not in any "value" but only in a "key". And ideas how to solve this?
I am very much looking forward to your kind help.
Greetings form Berlin!
I have issues with multiple problems, here and would kindly ask for hep from the pros on the group.
Problem 1 - knowing how many files are in the folder: When I look at the response that comes back from "Google Drive List Folder Content" command, I do not identify a key that holds the value of the amount of files inside the folder. If that doesn't exist, I guess we have to "count" the files somehow. I tried the iterator, but it needs an array as json and the GDrive responds is not shown as an array. What can I do here? Is there a way to convert the entire GDrive response into an array? Are there other ways to iterate through GDrive files or some other way to count them? Is there a way how to find the highest number seen in any "key"(not "value")?
Next I have to generate a random number between 1 and the prior-step-result-number. This seems easy with RANDBETWEEN(1, [prior-step-result-number]). No need for help.
Problem 2 - selecting the final result: Now, I got the random number and want to use that particular file in the next step of my flow. It is not clear to me how to map that file. As GDrive list response does not give me a key/value pair for a certain file count I need to select the file through it's name or Id, but the number I am looking for is not in any "value" but only in a "key". And ideas how to solve this?
I am very much looking forward to your kind help.
Greetings form Berlin!