Copy the last four characters (ie. $100) into another field

  • tsasf
    Asked on June 22, 2023 at 6:14 AM
    And I want to copy the last four characters (ie. $100) into another field because I want to calculate the totals.
  • Jeric JotForm Support
    Replied on June 22, 2023 at 6:49 AM

    Hi tsasf,

    Thanks for your patience. It's possible to copy the last four characters of the data from a field through Substring widget given that user will put an answer with the same number of substrings or characters including spaces. This is the challenge unlike if you call to copy the first few characters since they are fixed on a substring order. To describe what I mean, please check this demo form, and put White urn $100 on the product field. This has 14 characters including spaces. If you put a value with less or more characters, it'll only copy the substrings we call out on the settings of the widget which is fixed. In this form it's the 10-14 substring:


    Copy the last four characters (ie Screenshot 20

    To make the value constants at 14 substring, you can use the dropdown field and put options that only has 14 substrings. This ensures that no value that is more or less than 14 characters will be put on the field unlike if you have them put it manually. You can check this other demo form to describe what I mean.

    If this satisfies your needs and if you want more guide on how to set it up, please build you form and we'll help you out further.

  • tsasf
    Replied on June 23, 2023 at 7:13 AM

    Hi Jeric

    Thank you for your kindness in providing an extensive response.

    The Substring widget looks like it might work.

    However, the numbers of characters vary. Eg:

    Teak urn $110

    White urn $110

    However, what is consistent is that what I want to copy is the last 4 characters. Ie. all prices are either 3 or 4 characters at most.

    Might there be a way to do this?

    God bless

    Marc

  • Mary JotForm Support
    Replied on June 23, 2023 at 9:01 AM

    Hello tsasf,

    Thanks for getting back to us and for clarifying it. You're requirement is achievable by following my colleague's recommendation. As long as the Substring start and end is correctly accounted for, since the widget will copy the value based on that. In the example Demo form made, you will need to add a field where the widget will get the values from. In this case, we added a dropdown field containing the products with the prices.

    Copy the last four characters (ie Screenshot 60

    Then set up the parameters on the Substring widget. However, the tricky part here is how you will set the Substring part where all the products you have will have a fix value. Since, I noticed that the Substring widget might not be the best option for this case, because of the irregularities of the value.

    You want to consider using the Update/Calculate Field condition on your form instead. This is going to be limited to a single choice only. Using the same idea from the demo form, we will remove the widget and add a field (Short Text element) on the form where the value will be pass to. I named the field to "Value".

    Copy the last four characters (ie Screenshot 71

    Then, set up the values of the products. You will need to enable the Calculation Values for this to work. Click the Gear icon of the form field and go to the options section. Type in the Calculation Value beside the product options.

    Copy the last four characters (ie Screenshot 82

    Then, add the condition that will copy the value from the product field to the Value field. The condition will be triggered once the user selects a product from the product field. It will copy the value from there to the Value field. Don't forget to hit the Save button.

    Copy the last four characters (ie Screenshot 93

    This is how the form should work when it's set up correctly.

    Copy the last four characters (ie Screenshot 104

    Give it a try and reach out again if you have any other questions.

  • tsasf
    Replied on August 28, 2024 at 4:39 AM

    Hello

    One of the instructions above is to:

    "Type in the Calculation Value beside the product options."

    Might there be a method of doing this without typing it in manually?

    God bless

    Marc

  • Sawyer Executive Operations Specialist
    Replied on August 28, 2024 at 4:54 AM

    Hi tsasf,

    Unfortunately, the only way to add values to be used in calculations under the Dropdown Properties is to set them manually.

    Reach out again if you have any other questions.

  • tsasf
    Replied on August 28, 2024 at 5:17 AM

    FYI have now found an answer to the question above.

  • tsasf
    Replied on September 17, 2024 at 3:03 AM

    Hello

    Might it be possible to have product names and prices using either Autocomplete or Multiple Selection or other similar widget?

    Ideally, customers would be able to start typing before selecting and find the price automatically.

    The issue is that the product list is too long for Dropdown.

    For some more context, here is a small sample of the data I have:

    AUH102 Blue Heart (size n/a) $5.00

    TMBG BioGlitter - Silver (size fully certified biodegradable glitter) (size n/a) $10.00

    TMBG BioGlitter - Silver (size fully certified biodegradable glitter) NEW (size n/a) $10.00

    AU5270 Heart Stand - Antique Bronze (size n/a) $12.00

    God bless

    Marc

  • Chris_L JotForm Support
    Replied on September 17, 2024 at 3:57 AM

    Hi Marc,

    I moved your other question to a new thread and helped you with that here.

    Reach out again if you need any other help.

  • tsasf
    Replied on September 17, 2024 at 6:26 PM

    Thank you Chris.

    The issue now is that I cannot input/upload the items to the Product List in bulk (and remember I have 1,000+ products).

    What might be a better solution, if any?

    God bless

    Marc

  • Jessica JotForm Support
    Replied on September 17, 2024 at 11:01 PM

    Hi Marc,

    To avoid confusion with the other questions, we'll help your new question in a separate thread. Please refer to this thread, we'll help you there soon.

    We appreciate your patience and understanding in this.