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 / Set function not worki...
Power Apps
Answered

Set function not working within datacard

(0) ShareShare
ReportReport
Posted on by 21

Okay this is super weird....

I've got an "Edit Form" control with datacards.

Within one of the datacards I have a button and a textbox. The "Text" of the textbox is set to "var" and the button's "OnSelect" is set to "Set(var, "Hello World")".

jheislerrad_0-1643220125153.png

If I press the button, nothing happens.

Now for the fun part:

Same setup. Except, I'm using "var2" instead of "var" and the button and textbox are not in the datacard. They are in the root of the screen.

jheislerrad_1-1643220359516.png

 

Here is what these two look like after I press both buttons: (reminder, The one in the datacard is on top, and the one on the root of the screen is on the bottom)

jheislerrad_2-1643220474210.png

I do not understand what's happening here.

It happens on a different screen and form within the same app, but works fine I different app I built about 3 months ago.

Any information is greatly appreciated and I thank anyone who took the time to read this post. 😁

Categories:
I have the same question (0)
  • jheislerrad Profile Picture
    21 on at

    Update:

    I just created a completely new app to test this and I'm getting the same result.

    Was there some sort of change to the way edit forms work in PowerApps recently?

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @jheislerrad 

     

    What is your DefaultMode of the Form and the Item property of the form?

     

    If the form is in New mode by default, you should not see the problems you are.  If it is in Edit mode, then you need to supply a valid record for the Item property of the Form.  Same for View mode...need a valid Item record.

     

    So either set the form DefaultMode to New, or provide a valid record for the Item or set the Item to Defaults(yourDataSource).

     

    I hope this is helpful for you.

  • jheislerrad Profile Picture
    21 on at

    That was it!

    Thank you So Much!!!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard