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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Unable to get value in...
Power Pages
Unanswered

Unable to get value in portal from yes/no datatype column

(0) ShareShare
ReportReport
Posted on by 23

I have one entity that has a yes/no datatype column. I have a second entity that has the same yes/no datatype column with a business rule that updates the field based on the first entity (example: if table one column updates to "yes" the second entity column also updates to "yes")

 

I have brought the second entity column into my portal form as I want to hide a button if the value is "yes". My plan is to hide the column from the form but I wanted to bring it in so I could use it's value for JS.

 

At first it was in the form as radio buttons that did not have either yes or no selected, even though the column in the backend was "yes". I was getting empty values. I then switched it to a toggle on the form (which appears as a checkbox on the portal frontend). It does check and uncheck appropriately (based on "yes"/"no") however I cannot get a value from this either. Whether the box is checked or not, I am only returning "on". 

 

Any suggestions on how to tackle this? Thanks! 

Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @KellyMcLaren ,

    it could be, that you do not see the value of the selected box due to cache issues. This happens really often to my implementations. So if you check it in crm, and go immediatly to the portal chances are high, not to see the entry in the radio or whateverbox.

    In order to verify you could log in to the portal as an admin and clear the cache on my_portal_url/_services/about and clear the cache (this is of course not a production fix but a way to find out the problem of the uncheckd radio.)

     

    You really have to look at the dom how the things are rendered. When you have a checkbox, you usually have an attribute called "checked" which is to be looked at. When its there, the checkbox is checked, when it is absent, the value is false. If you render it as a listbox, you could get the value of the listbox (jQuery could do the job ("#my-boolcontraolascheckboxid").val(). If it is one, it is usually true (=checked).

    In case of radio, you have usually two entries with the id of the attribute (column) and an appended _0 and _1 respectively. Then you have to look, on which of those the checked attribute is set.

    Man possibilities, many ways 🙂

     

    To make things more complicated you could also do in the liquid template of the page (when ithe id of the record is passed in with the id-parameter) with something like:

    {% assign myentityid = request.params["id"] %}

    {% assign myentity = entities.myOneEntity[myentityid] %}

    {% assign mycheckboxvalue =  myentity.mycheckboxcolumn | boolean | default: false %}

    <script>

    function getMyOneEntry() {

      return {{ mycheckboxvalue }};

    }

    </script>

    ( see https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#entities and https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#request  for details on that one)

    Hope this points in a solution direction,

       Christian

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 17 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 12

#2
CN-06091549-0 Profile Picture

CN-06091549-0 12

Last 30 days Overall leaderboard