Receiving indefinite number of files from a user

Sometimes it is necessary to receive different files from the user but their number is not known in advance. The solution could be a cycle of fetching files and writing them to the same variable.

1. First set Buttons with Hints with Next button, which the user clicks when all the images are uploaded.

2. Then user should be forwarded to “wa SOS fork” Forward component.

3. In “wA SOS fork” screen set up Fork component.

Leave first Fork target Data Type as Text, Target value is set to Next, Transition to the screen is set to “wa SOS alert”.

Set the second Fork target Data Type to File, set variable name to sos_file. This variable will be set to files which user sends to the bot.

Transition to the screen is set to WA SOS cycle.

Target without value with File Data Type (Target 2) sets sos_file variable to file which is sent by user. That is why sos_file variable name is specified in Name of the variable which Fork sets the value field of Target 2.

At the same time Target 2 takes the user to WA SOS cycle screen where the image is already copied to the common variable sos_all_files and returns the user to the previous screen with the Forward component.

If, however, user uploads another image it is copied once again and added to the common variable beginning with a newline. This is repeated until the user presses Next button.

When the user presses Next button, they proceed to sending the shared variable where all the links to the images they have sent are stored.

All links to the files uploaded by user will be sent to @notification_from_bo