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 Apps / Help with Dropdown lis...
Power Apps
Answered

Help with Dropdown list to Number on Sharepoint

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi GUYS

 

Hope you can help I am a NOOB

 

I have made a Data sheet that sends data to sharepoint

 

2 of the data cards's is a Dropdown with (none,medium,low) etc... 

 

I have managed to use an if statement to say that IF the selection is "none" it wil write to a field in sharepoint which will then make it a 0

 

My coding is working but for some reason it is not writing anything to my CompLevelScore? I am not sure if it is to many IF statements?

 

Here is the code:

Patch(MITAssessment, Defaults(MITAssessment), {Title:NewTitleText_1.Text, Question:DataCardValue7_1.Text, WhyAreWeAsking:DataCardValue8_1.Text, Importance:DataCardValue9_1.Selected.Value,Finding:DataCardValue10_1.Text, ComplianceLevel:DataCardValue11_1.Selected.Value},If(DataCardValue9_1.Selected.Value="Low",{ImpLevelScore:1},If(DataCardValue9_1.Selected.Value="Medium",{ImpLevelScore:2},If(DataCardValue9_1.Selected.Value="Critical",{ImpLevelScore:3};

If(DataCardValue11_1.Selected.Value="Low",{CompLevelScore:1}, If(DataCardValue11_1.Selected.Value="Medium",{CompLevelScore:2},If(DataCardValue11_1.Selected.Value="Compliant",{CompLevelScore:3},If(DataCardValue11_1.Selected.Value="None",{CompLevelScore:0}))))))))

 

 

THANK YOU



Categories:
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi @Anonymous

     

    I wouldn't suggest using logic at that point and would rather have two labels somewhere on-screen that is using that conditional logic.

    So your label1 Text will be:
    If(
       DataCardValue9_1.Selected.Value="Low","1",
       DataCardValue9_1.Selected.Value="Medium","2",
       DataCardValue9_1.Selected.Value="Critical","3"
    )

     

    And your label2 Text would be:

    If(
       DataCardValue11_1.Selected.Value="Low","1",
       DataCardValue11_1.Selected.Value="Medium","2",
       DataCardValue11_1.Selected.Value="Compliant","3",
       DataCardValue11_1.Selected.Value="None","0"
    )

     

    Then your patch statement becomes:

    Patch(
       MITAssessment, Defaults(MITAssessment),
       {
          Title:NewTitleText_1.Text,
          Question:DataCardValue7_1.Text,
          WhyAreWeAsking:DataCardValue8_1.Text,
          Importance:DataCardValue9_1.Selected.Value,
          Finding:DataCardValue10_1.Text,
          ComplianceLevel:DataCardValue11_1.Selected.Value,
          ImpLevelScore:Value(label1.Text),
          CompLevelScore:Value(label2.Text)
       }
    )

     

    Could you try that and let me know how it goes?

     

    Thanks,

    Sancho

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi

     

    Thanks for all the awesome replies, they decided to leave the project so it was all a waste 😞

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard