# External files for variables

**URL:** <https://www.finalbuilder.com/forums/t/external-files-for-variables/6590>\
**Category:** Discussion\
**Created:** [September 19, 2019, 7:13am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590 "2019-09-19T07:13:12Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 19, 2019, 7:13am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/1 "2019-09-19T07:13:12Z")

</div>

Do the variables have any external file to save/ view? Or we can add the variables from local into FinalBuilder instead of inserting 1 by 1?

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [September 21, 2019, 2:50am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/2 "2019-09-21T02:50:15Z")

</div>

There’s no external load/save of variable definitions if that is what you are asking? You can load variable values from a file, see the Save/Load variables to/from ini file actions.

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 23, 2019, 1:34am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/3 "2019-09-23T01:34:58Z")

</div>

Thanks, I have another question about variables…  
Can I set the “Prompt for Variables/ Enhanced Prompt for Variables” actions automatically change all the variable i need after i selecting the group of variables I need?

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [September 23, 2019, 1:43am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/4 "2019-09-23T01:43:39Z")

</div>

You can use multiple prompt actions, the first one selecting the group and then use if else or switch case actions to show another prompt actions with the variables based on the selected value of the first one.

There’s no automatic/magic way of achieving this, there are just too many variations to make this usable.

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 23, 2019, 2:14am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/5 "2019-09-23T02:14:45Z")

</div>

If there’s more than hundred variables in the project with different markets. So, it means that every time I build, It will show hundreds of prompt action to archieve the build?  
Do you have any other suggestion to solve this problem?

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [September 23, 2019, 2:58am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/6 "2019-09-23T02:58:31Z")

</div>

No one is suggesting that you show hundreds of prompts. One prompt to select from a list of markets, then using Switch and Case action, choose a second prompt to display based on the value selected in the first prompt. The second prompt will include all the variables required for a single market.

It’s difficult for us to make any further suggestions without some details or examples of the types of variables you are working with and what you are trying to achieve.

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 23, 2019, 7:43am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/7 "2019-09-23T07:43:32Z")

</div>

Hi, Sparky  
Sorry for my bad explanation. I would like to ask about the Variables contained in the group (Image below).  
 ![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/2/2d4b7cb932a1dbf81d612f79f4e33629bfea3521.png)  
I want to build the project by differentiating from these groups of the variables. Because the system does not allow the variable in the same name so I planned to let all the variable send to the variable in “Main” to build the project.  
Therefore, I will only have a single target but can work with multiple markets.

 ![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/b/b97476257608b468aaef7ae5a9678c04347240db.png)

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [September 23, 2019, 8:23am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/8 "2019-09-23T08:23:48Z")

</div>

Sorry, but we’re still quite confused what you’re trying to do? What are the markets and what do you what to do different for each of the markets?

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 23, 2019, 9:18am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/9 "2019-09-23T09:18:22Z")

</div>

![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/1/1088d6d558cd39f19fe59461e20b3b3230786d82.png)  
This is a market I want to do like (not yet finish), each action has its own variable need to define. Then, when I want to use the same target to deploy another market, I will need to use another set of variable group to build for another market.  
So, I planned to use the “Main” group to work with the target(Branch\_1). To let the other group of the variable can pass the value to the “Main”. Therefore, I found that the “Prompt for Variables/ Enhanced Prompt for Variables” actions can help me replace the value before running the target. ![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/d/d0e0aed9450c96e604505a7c12bd11fd51ae7802.png)  
But in this case, it is a manual process, I want to build with automatically such as after select the market I need, then it will help me replace all the variable and run the target.

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [September 23, 2019, 11:56pm UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/10 "2019-09-23T23:56:24Z")

</div>

Still, not sure what you mean by ‘market’ here - maybe your application is customised differently for different groups of customers and these groups of customers are the markets? I’m also assuming that the group names correspond to the markets?

I have attached a project which attempts to do what I think you may be looking for.

[MarketSelection.fbp8](https://www.finalbuilder.com/forums/uploads/short-url/mqWqgSTBgxdf9WarDeSyQ3NrBor.fbp8) (4.7 KB)

This starts with an action to select a Market (either SG or MY). It then uses Switch and Case actions to choose a dialog to show depending on the selected market. Each dialog has the same variables but different default values.

Let us know whether this helps with your scenario, or if you want to do something different? Maybe you want to have different variables on the prompt dialog for each market? Or maybe you don’t need the second dialog at all and the variables can be set automatically using Set Variable actions. Or maybe we’ve completely missed the mark?

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 24, 2019, 2:16am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/11 "2019-09-24T02:16:09Z")

</div>

Thank you and yes I dont need the second dialog at all. So, I only need to add on the Set Variable actions?

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [September 24, 2019, 3:01am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/12 "2019-09-24T03:01:45Z")

</div>

Yes, you can add Set Variable actions instead of showing the dialogs. See the updated example: [MarketSelection.fbp8](https://www.finalbuilder.com/forums/uploads/short-url/uo49k6Ouatm1HM9SZ3uejueRAZQ.fbp8) (4.0 KB)

Alternatively you can load the variables from sections in an INI file [MarketVariables.ini](https://www.finalbuilder.com/forums/uploads/short-url/yD8DfXOHRYA2RiNDrB8VJCCCi3s.ini) (122 Bytes) . See this example project: [MarketSelectionFromIniFile.fbp8](https://www.finalbuilder.com/forums/uploads/short-url/A55Z55RqickMm8eA517yiCqitv7.fbp8) (2.7 KB)

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 24, 2019, 4:03am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/13 "2019-09-24T04:03:25Z")

</div>

Thank you very much!  
If I want to create new Variable with new Grouping, how to run from ini file?

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [September 25, 2019, 12:15am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/14 "2019-09-25T00:15:20Z")

</div>

Just add a new section to the ini file. e.g.

```auto
[GroupName]
New_Variable = variable_value

```

> **[INI file](https://en.wikipedia.org/wiki/INI_file)**
>
> The INI file format is an informal standard for configuration files for some computing platforms or software. INI files are simple text files with a basic structure composed of sections, properties, and values.
> In MS-DOS and 16-bit Microsoft Windows platforms up through Windows ME, the INI file served as the primary mechanism to configure operating system and installed applications features, such as device drivers, fonts, startup launchers, and things that needed to be initialized in booting Win...

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 25, 2019, 2:43am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/15 "2019-09-25T02:43:49Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 30, 2019, 9:36am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/16 "2019-09-30T09:36:24Z")

</div>

Hi, sorry for asking again on this post after several days…  
For the INI file can it add to the Tab instead of calling from the file every time?  
 ![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/c/cedd73bdc9b492b84b53d63ccf782223b54c27b6.png)

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 30, 2019, 9:42am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/17 "2019-09-30T09:42:37Z")

</div>

![image](https://www.finalbuilder.com/forums/uploads/default/original/2X/8/817fa515ca7a78558a5db43411f9be0a56a78638.png)

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [September 30, 2019, 9:48am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/18 "2019-09-30T09:48:56Z")

</div>

Do mean to actually define the variables when loading from the ini file? If that’s what you are asking then the answer is no. FinalBuilder is really like a statically typed langage, variables need to be declared before they can be used.

---

<div class="post-metadata">

**Author:** ![LowWeeLeong](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/85f322/32.png) [@LowWeeLeong](https://www.finalbuilder.com/forums/u/LowWeeLeong)\
**Post date:** [September 30, 2019, 9:52am UTC](https://www.finalbuilder.com/forums/t/external-files-for-variables/6590/19 "2019-09-30T09:52:27Z")

</div>

Okay, Thank you very much!
