cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yoursnani
Helper IV
Helper IV

Textinput default value in Edit screen

Hi ,

 I am new to power apps 

I am customizing SharePoint with powerapps I have currency column in SharePoint . when I enter value in new form its working fine. When I open Edit form its not showing before value . its showing empty. And I am using text input out of the box (out of the Data card) .please help me how I can get default data in edit screen

Thank you .

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User III
Super User III

@Yoursnani 

Then you are trying to separate the form interface from your form with your own custom controls.

If this is the case, then you need to utilize a variable for your record that you are editing.

Your EditForm will use the variable for its Item property.

 

For example, let's say you are selecting your record from a Gallery - in the OnSelect action of the Gallery you would have : Set(glbCurrentRecord, ThisItem)

Your Form Item property would be set to : glbCurrentRecord

Your Form would be set to Edit mode (always).

Your TextInput control (and others to follow this example) the Default property would be: glbCurrentRecord.'B-hours'

Repeat this for the other TextInput controls except specify their field/column name.

 

If you have a need to add new records, then for whatever action you have to add a record, you would set the formula to:  Set(glbCurrentRecord, Defaults('Project WBS'))

 

Again, your form will always remain in Edit mode and you should not use the NewForm, EditForm etc. functions.

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

RandyHayes
Super User III
Super User III

@Yoursnani 

Please re-read my response as I never mentioned an Item property on the TextInput.  You will only be concerned with the Default property of TextInput controls.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

10 REPLIES 10
RandyHayes
Super User III
Super User III

@Yoursnani 

Is the value being written to your list, or is it just that you are not seeing it when you return to edit the record?

Please provide the Update and Default properties for your datacard that contains this TextInput control as well as the Default property of the TextInput control.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes 

 

Please find the attachment of data card screenshot below

IMG_20210614_191050_compress39.jpg

 Please find the attachment of screenshot of textinput properties below

IMG_20210614_191112_compress39.jpg

RandyHayes
Super User III
Super User III

@Yoursnani 

Change the Default property of your TextInputBHU_2 control to : Parent.Default

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes 

 

It's not working . because I am using textinput control out of the Datacard, error is ""Name isn't valid. This identifier isn't recognized . is there any possible .

Thank you 

RandyHayes
Super User III
Super User III

@Yoursnani 

Is there a reason for it to be out of the DataCard?  What is currently in your DataCard?

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes 

Yes I am working for a project that holds almost 20 datacards and 20 text input . all datacards are in hide . only textinputs are in visible 

IMG_20210614_195059_compress2.jpg

RandyHayes
Super User III
Super User III

@Yoursnani 

Then you are trying to separate the form interface from your form with your own custom controls.

If this is the case, then you need to utilize a variable for your record that you are editing.

Your EditForm will use the variable for its Item property.

 

For example, let's say you are selecting your record from a Gallery - in the OnSelect action of the Gallery you would have : Set(glbCurrentRecord, ThisItem)

Your Form Item property would be set to : glbCurrentRecord

Your Form would be set to Edit mode (always).

Your TextInput control (and others to follow this example) the Default property would be: glbCurrentRecord.'B-hours'

Repeat this for the other TextInput controls except specify their field/column name.

 

If you have a need to add new records, then for whatever action you have to add a record, you would set the formula to:  Set(glbCurrentRecord, Defaults('Project WBS'))

 

Again, your form will always remain in Edit mode and you should not use the NewForm, EditForm etc. functions.

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

@RandyHayes 

Can you please explain me I don't understand 

 I don't find item properties of textinput . 

 

Thanks

RandyHayes
Super User III
Super User III

@Yoursnani 

Please re-read my response as I never mentioned an Item property on the TextInput.  You will only be concerned with the Default property of TextInput controls.

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,423)