• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

Upload and rename multiple files to google drive

Ulf

Member
I have a use case, where users upload their name, address and up to 3 audio files with fluent forms on my wordpress site. Since users are usually not very good at naming their files properly, I need to rename them to identify which file came from which user. When a form is submitted, the following automation is triggered: (Please see attached images)

1. Trigger: FluentForms: New form sent

2. Action: Router A: check if audio file is WAV, rename file to {first.name}-{lastname}.wav, upload file to Google drive folder

Router B: check if audio file is MP3, rename file to {first.name}-{lastname}.mp3, upload file to Google drive folder

This is already working very well with a single audio file uploaded! Now here is part where I am lost:
I want to allow users to upload from 1-3 files. So there are 3 different possibilities on how many files arrive. My question is:

1 - Is there a possibility to somehow loop the action until all files are processed and is there a way this works on a changing number of files with each form sent?

2 - Is there a way to insert an increasing count number from 1-3 into the renamed file like {first.name}-{lastname}{count-number}.wav

Thank you very much,
Ulf
 

Attachments

  • pabbly1.jpg
    pabbly1.jpg
    220.6 KB · Views: 99
  • pabbly2.jpg
    pabbly2.jpg
    157.7 KB · Views: 115

Neeraj

Administrator
Staff member
Do they send all the files in an array?

If yes, what you can do is, capture the webhook response by turning ON the advance button.

This will give you the whole array with all the files in that array.

Next use the Iterator module that loops through all the items in the array one by one.

Check the Iterator video here.
 

Ulf

Member
Actually I found a solution! After separating the links with text split, a seqence of upload and filter steps does the trick:

upload file1, then filter: check if text split result 2 starts with "https://" then continue, else stop - and going on like this for file 2 and 3.
So no tasks are wasted for trying to upload files that are not existing :)
 

Neeraj

Administrator
Staff member
Actually I found a solution! After separating the links with text split, a seqence of upload and filter steps does the trick:

upload file1, then filter: check if text split result 2 starts with "https://" then continue, else stop - and going on like this for file 2 and 3.
So no tasks are wasted for trying to upload files that are not existing :)
Wow, a new way to iterate. :)
 
Top