web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

allow users to add more values into power apps portal form?

(0) ShareShare
ReportReport
Posted on by 100

Hello,

i have a dropdown column with few values and there is "Other" one of the value. So as soon as user select "Other" value from the drop-down another text box will pop-up on the form. it was working before on the form but all of a sudden not displaying the text box.  is there any idea what could be the issue?

$(document).ready(function () {
    MyFieldChanged();
    $('#custom_preference').on("change", MyFieldChanged);
});

function MyFieldChanged() {
  $("#custom_text").closest("tr").hide();
    var selectedValue = $('#custom_preference').val();
    if (!!selectedValue && selectedValue == 881990007) {
      $("#custom_text").closest("tr").show();
    }
    else {
      $("#custom_text").closest("tr").hide();
    }
}

3007.Capture.JPG_2D00_640x480-_2800_1_2900_.jpg

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Rakki,

    I tested your code on my side and it could work fine.

    Below is my test:

    1. Add JS code to my basic form.

    pastedimage1650348265687v1.png

    Result:

    perferfance.gif

    You can try the following points:

    1. Clear the cache of your browser and reopen your portal.

    2. Press F12 to see there is any error.

    3. Debugger your code to see that does it run well.

  • Rakki Profile Picture
    100 on at

    Hello Steve,

    Thanks for your reply. alert function is working within JavaScript but text field not displaying. i am using advanced form within the wizard and entering the JS into form options.

    so how can i debug the JavaScript which residing into CRM Backend?

    pastedimage1650489440530v1.png

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Rakki,

    You could add debugger; or console.log(object) in you code. Something like this:

    $(document).ready(function () {
        MyFieldChanged();
        $('#custom_preference').on("change", MyFieldChanged);
    });
    
    function MyFieldChanged() {
      debugger;
      $("#custom_text").closest("tr").hide();
      console.log($("#custom_text").closest("tr"));
        var selectedValue = $('#custom_preference').val();
        if (!!selectedValue && selectedValue == 881990007) {
          $("#custom_text").closest("tr").show();
        }
        else {
          $("#custom_text").closest("tr").hide();
        }
    }

    Then press F12 to debug or view the console.

  • Rakki Profile Picture
    100 on at

    Steve,

    appreciated for your reply. i was able to debug and noticed when i am selecting "Other" from drop-down is getting "undefined" value and getting into else condition to hide the text box. what could be the reason to get "undefined" value and how to resolve it?

    Thanks in advanced.

    0815.Capture.JPG

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Rakki,

    Based on the screenshot you provide, the issue should cause by your filed name is wrong. Please change $('#les_Perference').val() to $('#les_perference').val() at line426 in your screenshot.(The P should be lower case as the same as  it at the line419)

  • Rakki Profile Picture
    100 on at

    Hello Steve,

    Still "Others" text box not showing up on the form even though Other option value is getting "100000007" when selected from the drop-down as you can see in the below picture. what else causing the issue you think?

    Appreciated for your help.

    pastedimage1650899795450v1.png

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Rakki,

    Based on your code, it should work if your logical name "#les_others" is correct. You could press f12 to check it.

    pastedimage1650937013919v1.png

    And I noticed that the other would show whatever your if condition is true or false.

    Please change to code like this:

    if(selectedValue && selectedValue == 100000007){
    console.log(true);
    $("#les_others").closest("tr").show();
    }
    else{
    console.log(false);
    $("#les_others").closest("tr").hide();
    }

    And you could know which branch is executed by the output in console. Please clear your cache to have a try.

  • Rakki Profile Picture
    100 on at

    Thanks Steve for your answer.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 47 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
Pallavi Phade Profile Picture

Pallavi Phade 32

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans