davidkm
Posts: 1
Joined: Wed Jun 14, 2023 11:44 am

Build a text based on controls in a a dialog

Hi,

I have a dialog with two comboboxes where users will select region and environment. I need to build a url based on the combobox selections.

For e.g.
If region is US and environment is Production url construction will be
https://{region}.example.com

and if region is EU and environment is test the url should be
https://{region}.{environment}.anotherexample.com

After this I need to update this value to my appsettings.json.

Thanks in advance.
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Build a text based on controls in a a dialog

Hello and welcome to our forums,

In order to achieve this, please follow the steps below:

1. Click on the Next button of your dialog --> Published Events tab and click on the New... button.

2. Here add two Set installer property value events, like this:
    where:
    • MYURL is the name of your property from the Properties page. If you do not have one already, you can create it.
    • COMBOBOX_1_PROP and COMBOBOX_2_PROP are the properties name of your ComboBox controls.
    • "EU", "US", "Production", "Testing" are the values of the ComboBox controls.
    published events.png
    published events.png (58.64 KiB) Viewed 3856 times

    After that, the MYURL property will be set according to the user's selection. Then you can use this property in your .json file.

    Please find attached a sample project. On the FolderDlg is displayed the URL value in an EditBox control.
    sample url.aip
    (18.59 KiB) Downloaded 129 times
    Hope this helps! If you have any other questions, please don’t hesitate to contact us.

    Best regards,
    Liviu
    ________________________________________
    Liviu Sandu - Advanced Installer Team
    Follow us: Twitter - Facebook - YouTube

    Return to “Building Installers”