cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jaimat
Frequent Visitor

Change Text of text input through variable

I am changing Text of a text input (which is always in view mode) by different approval buttons in a customized SharePoint list form. For this, I created a variable which I go on assigning different texts . I  put the default of the text input to that variable. It works fine in new form.

 

But when the form is saved and opened to edit for further action that text input takes the initial value of the variable in place of the saved value of the field in the Share Point  list. It is saving correctly to the last changed text before save through the data card update field.

 

How can I get the saved value in the text input field in the edit form, while continue to change the text input text through variable on selecting the buttons!!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @jaimat ,

Could you please share a bit more about the variable initialization in your custom form app?

Do you want the Text Input box to be filled with the saved field value from your SP List when you edit an existing record?

 

Based on the needs that you mentioned, I have made a test on my side, please try the following workaround:

Set the OnEdit property of SharePointIntegration to following:

Refresh('Your SP List');
If(                         // add this formula
   !IsBlank(SharePointIntegration.Selected.FieldName),
   Set(VariableName, SharePointIntegration.Selected.FieldName)
);
EditForm(SharePointForm1)

 

Set the Default property of the Text Input Box in your custom form to following:

If(
   !IsBlank(VariableName),
   VariableName,
   ThisItem.FieldName
)

 

Please try above solution, check if the issue is solved.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks a lot for the solution. It took me time to test. It works.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @jaimat ,

Could you please share a bit more about the variable initialization in your custom form app?

Do you want the Text Input box to be filled with the saved field value from your SP List when you edit an existing record?

 

Based on the needs that you mentioned, I have made a test on my side, please try the following workaround:

Set the OnEdit property of SharePointIntegration to following:

Refresh('Your SP List');
If(                         // add this formula
   !IsBlank(SharePointIntegration.Selected.FieldName),
   Set(VariableName, SharePointIntegration.Selected.FieldName)
);
EditForm(SharePointForm1)

 

Set the Default property of the Text Input Box in your custom form to following:

If(
   !IsBlank(VariableName),
   VariableName,
   ThisItem.FieldName
)

 

Please try above solution, check if the issue is solved.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks a lot for the solution. It took me time to test. It works.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,488)