Form Components - How to show text on the basis of selection

So, thanks to @Jeff_Hager and @ThinhDinh, I have moved forward on my application.

I have created a form that contains,

a. A dropdown with 2 options.
b. Radio buttons that dynamically appear on the basis of the selection in the dropdown
c. A text message - Think of it as a result or answer, depending on the options chosen in the dropdown AND the radio buttons.

I have several doubts here.

  1. There is a Submit button at the bottom of the form by default. Pressing this button saves the data to a table. However, the data is saved in a random row, most often in the 6th/7th row. Is there are a reason for this? Can this be changed?
  2. I have used the viewability option to dynamically load radio buttons from a table on the basis of the option chosen in the drop down. This works without “Submitting” the form. See below,

The five radio buttons above are linked to the “Resident” Option. When I select the first option, the message “Your income is taxable in India” is displayed. This is based on a Visibility condition that I have applied to the text.

The visibility conditions that I have used for this text are as follows,

This works fine. Note here that the Visibility Conditions draw data from the Column called Resident_Second Level_W. However, the column is empty since I have not pressed the ‘Submit’ button in the form. I am not sure from where the status of the radio button is being picked from, but yes, the dynamic text works.

The problem arises when the second item in the drop-down is selected.

The text “Your Income is taxable in India” should ideally be appearing above the Submit button just like the earlier text message. The same column is being referred to. However, the text that is shown is “Your income is not taxable in India”. This is was actually the result of the selection of "Resident"in the drop down and a radio button that followed, just a few secnod back when I was testing the options. This text hasn’t vanished and continued to remain even when a different option in the drop down is selected.

I have tried to solve this issue by using an AND condition to the content of the dropdown but I have noticed that we cannot have an AND and an OR conditions for a single component. It is either AND or OR. Not both.

Looking forward to some suggestions.

Thank you in advance.

I haven’t fully followed your case. From a quick glance, I noticed that you didn’t include visibility settings for the text message component based on the dropdown selection (First_Level) of whether it is resident or non-resident. It would be better to use an ‘and’ relationship and add it to the second level options. Example: First_Level is Resident/non-Resident and second_Level is not empty and second_Level is (or is not) ‘None of the above are correct’.

Native Forms and Form Containers are designed to Add Rows by their nature. They will always have a submit button, and a new row will always be written to the end of whichever table the form is set to write to.

I’m not sure what you mean by a random row. Like I said, a form will always natively at a row to the end of the table you have chosen as the destination for the form.

Form data lives in a temporary state. The values exist in memory, but have not been written to a table yet, so even though you don’t see values written to the table yet, imagine that they are, but the submit button just commits them.

I’m kind of surprised that you didn’t see both taxibil and non-taxible message, but maybe I overlooked something in your screenshots. Yes, IF condition functionality is severely lacking in my opinion, but I’ve been complaining about it for a long time with no improvements.

In any case, I think I would restructure your choices a bit. Your visibility conditions end up being very verbose and prone to issues if you change the wording even a little bit. I think your first level choice component is fine and can write Resident or Non-Resident. For your second level choice components, I would consider merging then into one, and then add a filter to filter the values based on the screen value of the first level choice. This first step will help eliminate a lot of your issues. Then, I would probably change the second level choice to write a coded value instead of the full description. For example, maybe it writes 001-R-T, 002-R-NT or 001-NR-T, 002-NR-NT. That alone will give you enough information to know if the value is Resident, Non-Resident, Taxable or Non-Taxable…all in that simple code. That way you only need two text components. One that checks if the choice contains ‘-T’ for taxable and one that checks if the choice contains ‘-NT’ for non-taxable. You could enhance it with 4 text components like you have and add AND conditions that check if the value of the first level choice is Resident AND the second level choice code contains ‘-R’ AND the second level choice code contains ‘-T’ example. The benefit of doing all of that is that everything becomes data driven. You set it up once and if you want to add, remove, change and choice options, you can in the data table without having to reconfigure any visibility conditions.

4 Likes

Dear @Jeff_Hager thank you for the suggestion.

I understand replacing the verbose data with simpler structures. But I am not sure how this will solve the problem. I’ve tried implementing your suggestion.

  1. Merge the Second Level into one column - Done

  1. Use a filter - I have created a new column to assign values to the Secnod Level entries. “Both” is for those entries that should appear for both the selections in the drop down and “Resident” for that entry which should appear only when the option "Resident"is selected in the drop down.

I have introduced two filters, One to check for entries which have been tagged to “Both” and another to check for entries tagged to the value selected in the drop-down.

Result: Won’t Work.

The filter condition Second Level Category is First Level_W doesn’t work. This is linked to your earlier clarification about how data is stored in a temporary state and is not submitted to the table. Even when Submit button is not clicked, First Level_W is not empty works absolutely fine in the Visibility options. However, When I use the same First Level_W in the Filter to check if I have “Resident” in the Second Level Category, it doesn’t work. This maybe because, in the temporary state, the variable “Resident” is stored in some other form (hex, binary, etc.?). So “is not empty” works but not an exact match with the word “Resident”. I am not sure.

If it worked, all 4 entries in the Second Level column should have appeared. However, only 3 appear when “Resident” is chosen. By logic though, the list of radio buttons appearing when “Non Resident” is chosen is correct because, the second filter condition works absolutely fine (Second Level Category = “Both”).

Have I undestood your suggestion correctly?

Need guidance once more!
THanks in Advance!

Is your filter using Screen Values?

Screenshot_20240907-083006

1 Like

No. It doesn’t at the moment.
Should it?

If yes, I’ll review a bit about it and try to implement.

Yes, because you are trying to filter based on the selected value on the form screen. Not by a value that comes from the table.

2 Likes

Thank you @Jeff_Hager

Am I doing this right? It appears to be wrong since no option appears in the radio buttons.

Second Level Category contains the tags “Resident” and “Non Resident” to match the option chosen in the drop down.

First Level is chosen within the Screen option to compare the rows in Second Level Category with the option chosen.

There are three rows that contain the Resident tag. However, none appear. I have tried both the “is” and the “is included in” options. Neither works.

Can you show what your table currently looks like? Also show the components panel on the left side.

1 Like

Here is the database

And here are the Component details

Had to recreate your setup to see what’s wrong and I thing it’s something that your screenshots are not completely showing. Your filter is wrong for a couple of reasons.

  • First, you are checking if the the list of second choice categories is included in the first choice. All of them are included if your first choice is Non Resident, which contains both non resident categories as well as resident categories. Just change it to ‘is’ since you are looking for identical matches instead of partial matches.
  • Second, and most importantly, your filter is looking at the screen value of ‘First Level’. You are not filling ‘First Level’. You are filling ‘First Level_W’, so that’s the one you should be filtering against. Couldn’t tell that from the screenshots because they don’t show the entire name of the column that was selected in the filter.
3 Likes

@Jeff_Hager

Thank you for taking out the time for clarifying my doubts.

It worked!

I am placing screenshots of the table and the filter to help you understand what I did here. For options which should appear under both *Resident * and Non Resident, I have entered the code Both in the Second Level Category column. For the value that should appear only when Resident is selected, I have entered the code as “Resident”.

In the filter, I have used to check against the Screenvalue of the first dropdown OR the value in the column.

While it works, I wanted to know if we can make this more efficient.

Thank you nonetheless.

More efficient how?

There are two ideas in mind,

  1. I recall your reference to writing codes to the table instead of full descriptions,

For example, maybe it writes 001-R-T, 002-R-NT or 001-NR-T, 002-NR-NT. That alone will give you enough information to know if the value is Resident, Non-Resident, Taxable or Non-Taxable…all in that simple code. That way you only need two text components. One that checks if the choice contains ‘-T’ for taxable and one that checks if the choice contains ‘-NT’ for non-taxable.

This, in my opinion is more efficient that marking specific entries as Both or Resident, which is not scalable really, when the number of options blows out into large numbers.

I wanted to understand if codes can be written to the table without using the Submit button so that the codes can be used in filters.

  1. The Submit button is still an eyesore. It has no functionality and is a distraction to the user. Is there a way to remove the visibility of the Submit button? Or, in my case, where text message results are instant, what functionality can the Submit button serve?