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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help - If function wit...
Power Apps
Unanswered

Help - If function with datacardvalue vs dropdown box

(0) ShareShare
ReportReport
Posted on by 12

Hello all,

 

I have a custom canvas app that uses forms from a sharepoint list.  I am trying to build in some validation.  In my equipment inspection form the user will select many dropdown boxes that have a choice of either "pass" or "fail".  When trying to use if(datacardvalue.selected.value = "fail", true) set on visible on my test label I can not get it to work.  If do this with an input dropdown box outside of a form I can make it work.  Any help would be appreciated.

 

Label - Visible - If(Dropdown1.Selected.Value = "906", true)  this works  and my label displays

Label - Visible - If(DataCardValue37.Selected.Value = "906", true)  this does not work

Categories:
I have the same question (0)
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Rxdpunk 

     

    Double check your formula if it really references the right ComboBox. I did a test on my side and for me it is working fine.

     

    I have a form based on a SharePoint List, a column named myChoices which is a choice field with allowwed values of "Fail" and "Pass".

    I use this formular on the <Visible> property of a label:

     

     

    If(DataCardValue10.Selected.Value = "Pass",true,false)

     

     

    If you still having issues please let me know and provide some more details about your form and maybe a screenshot of the controls/formulars.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Rxdpunk Profile Picture
    12 on at

    Thanks for the reply.  Still not working on my end.  But I am very newb to this.Capture1.PNGCapture2.PNG

  • Rxdpunk Profile Picture
    12 on at

    I tried it without the "false" in there as well

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Rxdpunk 

     

    Is DataCardValue37 a MultiSelect ComboBox?

     

    PowerRanger_0-1603654382951.png

     

  • Rxdpunk Profile Picture
    12 on at

    No it is not.  The user should only be allowed to select one item.

    Capture3.PNG

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Rxdpunk 

     

    Could you make a Screenshot of the field in SharePoint to see it's settings.

  • Rxdpunk Profile Picture
    12 on at

    @PowerRanger  does this help ?

     

    Screenshot 2020-10-25 175235.png

  • Rxdpunk Profile Picture
    12 on at

    @PowerRanger 

    Capture4.PNG

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Rxdpunk

     

    YYes and no. This looks just like the column I created and for me it is working just fine with the formular I posted before. 

     

    Could you please try the following

     

    1. Create a new list with a choice column, choices are Pass and Fail

    2. Create a new app, add this list as a datasource, add a Form to the app and just select the title field and the choice field as fields.

    3. Add a label and Set the text to show anything

    4. Use the formular from my previous post in the Visible property of that label

     

     

  • Rxdpunk Profile Picture
    12 on at

    @PowerRanger    Sorry, for the delay.  But, I had time today do do what you asked.   I created a new Sharepoint List.  It only has the title column and a choice column "Pass, Fail".   I created a new canvas app.   I added this list as my data source.  I insterted a new form.  The list is set as the data source for the form.  I have title and choice as the only fields.  I tried the code you posted and it is not working for me.  I have included screenshots. PassOrFail01.PNGPassOrFail02.PNG

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard