Page 1 of 1

Action List and Variables

Posted: Tue Aug 01, 2023 7:58 pm
by SergioFernandez
Hi Support. I have the following scenario:

I am creating a Preflight Profile and adding some actions list in the Extra section. However, I would like to restrict with variables the execution of the action list. Please see the following example:

The user must be prompted to select a format from a list:
Example: Format 1, Format 2

If the user selects Format 1, then the Action List 1 should be run.
It the user selects Format 2, then the Action List 2 should be run.

Please, could you recommend me how to set the variables set and restrictions in the profile?

Thank you very much!

Re: Action List and Variables

Posted: Tue Aug 01, 2023 8:56 pm
by loicaigon
Hi,

It's feasible using variables. For my demo, here is my set of files:

Action lists:
blue_circle: this one draws a blue circle
red_circle: this one draws a red circle

Preflight profile
circles: dummy profile attaching 2 actions lists as changes.

Now variability:
Use a variable sets with three variables:
Format:text variable (Say values A & B)
makeBlueCircle:boolean, rules based, true if format is A, false otherwise.
makeRedCircle:boolean, rules based, true if format is B, false otherwise.

Now back to the profile, enable variables and condition action execution (boolean) to the value of makeBlueCircle for action list blueCircle and makeRedCircle for action list redCircle.

Now run, user is asked for format. If it says A, blue circle appears. If he says B, red circle appears.
Image

Of course my circles demo has no point but to show how you can condition action execution with variables ;)

Image

The profile:
https://fromsmash.com/SgqH7pjih3-ct

HTH

Loic Aigon
Enfocus PitStop pProduct Manager

Re: Action List and Variables

Posted: Mon Aug 07, 2023 6:56 pm
by SergioFernandez
Thank you very much for your reply. It was very useful. I was able to do according to your comments and is working well.

Re: Action List and Variables

Posted: Mon Aug 07, 2023 7:08 pm
by loicaigon
Glad I could help.

Re: Action List and Variables

Posted: Mon Dec 25, 2023 3:19 am
by changelowly
Thank you for sharing this great topic. I have access to a lot of useful information.

Re: Action List and Variables

Posted: Tue Feb 27, 2024 10:23 am
by elsieaortega
1. Define Variables:

Create a Variable Set named FormatSelection (or any suitable name).
Within this set, define two Boolean variables: Format1Selected and Format2Selected.
2. User Input:

In the "Extra" section of your Preflight Profile, add a User Input action.
Configure this action to:
Prompt: Ask the user to select a format (e.g., "Select Format:").
Options: Provide the available formats, such as "Format 1" and "Format 2".
Store in variable: Set this to the FormatSelection variable set.
3. Conditional Execution:

Add your Action Lists (Action List 1 and Action List 2) to the Preflight Profile.
Before each Action List, add a Conditional Action with the following settings:
Condition: Use a Variable condition.
Variable: Select the FormatSelection variable set.
Operator: Set this to "equals".
Value:
For Action List 1: Set the value to "Format1Selected".
For Action List 2: Set the value to "Format2Selected".
4. Setting Variable Values:

In the User Input action, when the user selects "Format 1", set the value of Format1Selected to true and Format2Selected to false.
Similarly, when the user selects "Format 2", set the value of Format1Selected to false and Format2Selected to true.
Explanation:

The Variable Set stores selections made by the user.
The User Input action captures the user's format selection and stores it in the variable set.
Conditional Actions only execute the associated Action List when the corresponding variable (Format1Selected or Format2Selected) is set to true.
Setting the variable values in the User Input action ensures that only the selected format's corresponding action list runs.