Skip to content

Is it possible to use a dynamic file path on a runScript action? #1442

Answered by simon-gilmurray
jbarriojim asked this question in Q&A
Discussion options

You must be logged in to vote

Hmm this might be an issue with the way you're trying to load it within the env at the start of the file, or it might be that runFlow doesn't like the JS parameter

Perhaps you can achieve this within the flow with something like this? (I haven't tested):

- evalScript: ${output.setLanguage = "/languages/" + LANG + ".js"}
- runScript:
    file: ${output.setLanguage}

If this doesn't work, then I'd be tempted to call out to a separate flow that has conditionals that loads the correct language file based on the parameter you've passed in, e.g.:

- runScript:
    when:
      true: ${LANG == 'Spanish'}
    file: /languages/spanish.js
- runScript:
    when:
      true: ${LANG == 'French'}
    fil…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@jbarriojim
Comment options

@simon-gilmurray
Comment options

Answer selected by jbarriojim
@jbarriojim
Comment options

@jbarriojim
Comment options

@simon-gilmurray
Comment options

@jbarriojim
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants