powered by ASAP

1. Summary

The Command ChooseFileOrDirectory lets the user choose from the local file system. The command gives an option to choose a file or a directory.

Both commands can only be used inside the Workflow Executor

2. Examples

ChooseFileOrDirectorySCR
Figure 1. The Command

The typeToChoose input parameter is necessary to start the command. With this you can choose whether a file or directory chooser is opened.

The throwOnNoSelection input parameter gives an option to enable or disable the thrown error if no file is selected. By default, this is enabled.

Due to simplicity, the title input parameter will be left empty for the examples. By default, it is set to „Choose a file“ and „Choose a directory“.

2.1. Choose File

For this we need to select FILE in the typeToChoose input field.

ChooseFile1
Example 1. Command run no additional input

The selected file will be written under the key chosenPath as "C:\\Users\\user\\Downloads\\Workflow Executor Setup (7).exe" in this case.

Sometimes however, you might want to restrict the file types that are shown to the user, this can be done by providing the fileType parameter. If we for example only want to allow gifs, we can set fileType to ["gif"]. Additional file types (e.g. png files) can be added by extending the fileType input to e.g. ["gif","png"].

ChooseFile2
Example 2. Command run with restricted file types

2.2. Choose Directory

For this DIRECTORY needs to be chosen in the typeToChoose input field. Then the command offers analogous functionality as described above. However, you cannot provide any file extensions as those can be emitted for directories.