Archy Substitutions in Expressions

Hello,

I´m trying to use substitutions in a 'yaml' file for three different cases, and none of them seems to work. The aim to use these substitutions is to modify easily the name of some variables in an options file. These are the three cases with some examples that I've already tried unsuccessfully:

1. Audio expression

a) exp: "Append(ToAudioTTS("We identified you as "), ToAudioTTS(Task.{{first_name}}))"
b) exp: Append(ToAudioTTS("We identified you as "), ToAudioTTS(Task."{{first_name}}"))
c) exp: Append(ToAudioTTS("We identified you as "), ToAudioTTS("Task.{{first_name}}"))

2. Switch case value expression

a) exp: "If(Task.{{first_name}} == "", false, true)"
b) exp: If(Task."{{first_name}}" == "", false, true)
c) exp: If("Task.{{first_name}}" == "", false, true)

3. References ('ref') path expressions

a) ref: ".././references/IdentificationDataActions.yaml#/actions/{{data_action_name}}[ani_data_action]"
b) ref: .././references/IdentificationDataActions.yaml#/actions/"{{data_action_name}}"[ani_data_action]
c) ref: .././references/IdentificationDataActions.yaml#/actions/"{{data_action_name}}[ani_data_action]"

If someone could help me to use substitutions in any of these 3 cases I would appreciate it. These are the only situations in which I didn't make substitutions to work properly.

Thanks in advance!

Hi mfabrellas,

Thanks for reaching out. Here's what I was able to find that worked for number 1 and 2 in your post:

  1. Append(ToAudioTTS("We identified you as "), ToAudioTTS(Task.{{first_name}}))
  2. If(Task.{{first_name}} == "", false, true)
    Number 3 however, does not seem possible. References are processed before any of the substitutions are made. As found on this page's FAQ section: When the Archy preprocessor runs and processes a flow, it resolves out all externally referenced objects and embeds them in the flow. Once all externally referenced objects are embedded, the Archy preprocessor then performs substitution replacements.

This means that it will fail to find the externally referenced objects to embed since it wont be able to find the {{data_action_name}} action in your IdentificationDataActions.yaml file.

Thanks,
Jon

Hi @jon.vansteen ,

Thanks for the quick answer. It works perfectly for cases 1 and 2. For case 3, that reason would explain why it doesn't work for references.

Anyways, thank you very much.

Miguel.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.