Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Question - Pass or Fail based on fields being chosen yes or no

Posted on by

Hi, 

 

I have a form, this form is connected to a sharepoint list - i also have a column in my sharepoint list for "Pass" or "Fail" - at the moment this is populated as empty. 

 

I need to fill this with either pass or fail based on the outcome on the dropdown boxes within the form. 

 

i.e. 12/12 say "Yes" - it need to populate "Pass" 

10/12 say "Yes" and the remainder say "No" - It needs to populate "Fail"

 

Do any of you guys know the best way of doing this. I have tried doing a count of all that say yes and then  comparing that in order to populate but this does not work. I cant seem to get the variable to initialise within onstart. 

 

 

Any help would be much appreciated. 

 

Thank you! 

  • Verified answer
    PowerNovice Profile Picture
    PowerNovice on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    PowerNovice_0-1701266466161.png

     

  • PowerNovice Profile Picture
    PowerNovice on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    Hi @AARON_C ,

     

    That works thank you! 

     

    PowerNovice_0-1700048016424.png

     

  • AARON_C Profile Picture
    AARON_C 2,241 on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    @PowerNovice 

     

    Try this on the Default property then and change the it to just "Fail" and "Pass"

  • PowerNovice Profile Picture
    PowerNovice on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    Hi @AARON_C ,

     

    The column uses a text datacard - i cant seem to find that property DefaultSelectedItems, so i have put it in the default, but i am getting an error. 

    PowerNovice_0-1699976520846.png

     

     

  • Verified answer
    AARON_C Profile Picture
    AARON_C 2,241 on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    @PowerNovice 

     

    For your DefaultSelectedItems property of your column with the choice "Pass" or "Fail" in your form.

    If(
     // Logical condition
     DataCardValue1.Selected.Value = "No" ||
     DataCardValue2.Selected.Value = "No" ||
     DataCardValue3.Selected.Value = "No",
     // If true
     {value: "Fail},
     // Else
     {value: "Pass"}
    )
    
     

    This works in dataverse.

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • PowerNovice Profile Picture
    PowerNovice on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    Wait sorry @AARON_C i have one dropdown which needs to be no in order to pass as well "No obvious damage" = No not Yes

  • PowerNovice Profile Picture
    PowerNovice on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    Yes Correct

  • AARON_C Profile Picture
    AARON_C 2,241 on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    @PowerNovice 

     

    Okay, so if any of the drops down say no, you want the outcome to be fail?

  • PowerNovice Profile Picture
    PowerNovice on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    Hi @AARON_C ,

     

    Please see below;

     

    PowerNovice_0-1699971306723.png

     

  • AARON_C Profile Picture
    AARON_C 2,241 on at
    Re: Question - Pass or Fail based on fields being chosen yes or no

    Hi @PowerNovice,

     

    Can you please show me your current form.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard