cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jheislerrad
Advocate I
Advocate I

Set function not working within datacard

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. 😁

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
jheislerrad
Advocate I
Advocate I

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?

RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

That was it!

Thank you So Much!!!

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (2,715)