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 / Assign variable value ...
Power Apps
Answered

Assign variable value based on DataCardValue

(0) ShareShare
ReportReport
Posted on by 95

Hello,

 

I am trying to set up a varible value based on datacardvalue selected but it is giving me an error

 

If(DataCardValue23.Selected.Value = "customer value", Set(ScoreNew, ScoreNew+1))

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at
    @Imahmuti

    Please supply a screenshot of the error message you received.
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @lmahmuti 

    You will need to place the formula in a control that has the ability to complete an action.  For example in the OnChange property of the Textbox control.  Since your If() statement does not contain DefaultResult. If( Condition, ThenResult, DefaultResult ), your statement will return blank if the condition is not met.

  • lmahmuti Profile Picture
    95 on at

    Hello,

     

    I got the DataCardValue resolved now I am struggling to get a patch to sharepoint to work. See code below

     

    Patch(Mentors_2,Default(Mentors_2),{ScoreNew:ScoreNew.value,ScoreSpec:ScoreSpec.value,ScoreEx:ScoreEx.value, ScoreT:ScoreT.value, ScoreO:ScoreO.value, ScoreP:ScoreP.value, ScoreS:ScoreS.value});Navigate(Home)

     

    Where I have title of the sharepoint matching the name of the variable but it is giving me an error. Can you help with this?

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    HI @lmahmuti ,

    It would be better if you have a second question to make a new item rather than adding on to one that is already answered.  Other community members will not be able to find the second question easily.  Also, if you have figured out a solution to your question, you should either tell the rest of us how you did it or give credit to someone who has answered it for you. 

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard