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

Append Text Input to Multi Line Text Field on Edit Screen

I am creating a visitor application

 

  • I have created a SharePoint Multiline text field and placed that on my Edit Screen
  • I have added a text input field and a ADD icon (+)
  • My goal is to
  1. Have the user type in someones name
  2. Select the ADD icon
  3. Have the entry Appended to a new line on the Multi line text field 
  4. Empty the text input field 

Below is my example 

 

Or maybe tell me if there is a better way to accomplish this 

 

my examplemy example

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Append Text Input to Multi Line Text Field on Edit Screen

Hi @marcgiag ,

Based on the needs that you mentioned, I think a collection could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

1.JPG

 

2.JPG

Set the OnSelect property of the "+" Icon to following:

Collect(NameEntry, TextInput1.Text);Reset(TextInput1)

 Set the Default Property of the Visitor Names (s) Text Box to following:

If(
   EditForm1.Mode = FormMode.New, // EditForm1 represents the Edit form in your app
   Concat(NameEntry, Value & Char(10)),
   Parent.Default
)

Set the OnVisible property of current screen to following:

Clear(NameEntry) // clear NameEntry collection

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best 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

3 REPLIES 3
Highlighted
Community Champion
Community Champion

Re: Append Text Input to Multi Line Text Field on Edit Screen

Hi @marcgiag ,

So I understand this right

  • Neither the input text field nor the add icon are on the form
  • The multi line SharePoint field is on the form
  • You are submitting the form by the normal SubmitForm function.

As a suggested possible solution, all of this code below needs to be on the OnSelect property of the Add icon. I will call the text box AddName and the form field VisitorNames

So the first thing you need to do is get the text already in the box. I will call the Variable vVisitorTxt.

UpdateContext({vVisitorTxt:VisitorNames.Text})

Now you add the new name to it - the bit in the middle should give you a new line

UpdateContext(
   {
      vVisitorTxt:
      vVisitorTxt & 
      uriComponentToString('%0A') & 
      AddName.Text
   }
); 
Reset(VisitorNames)

Now the last bit - getting the value back into the form field. The last line above leads into it - you need to use the Default value of the field here. I do not know what other processes you use on this form, so I will use something I hope does not affect them. Set the Default value of the VisitorNames field to

If(
   !isBlank(vVisitorTxt),
   vVisitorTxt,
   Parent.Default
)

What should happen here is when the field is reset by the add script, it will look for its default value, which as long as there is something in vExistTxt is that value. The last bit is to ensure that when the form is opened, it displays the existing data.

After all of this, your form should save the new data in the field.

The last thing you need to do is reset the variable otherwise it will still be there for the next record. So on both the save and exit screen scripts, add this at the end.

UpdateContext({vVisitorTxt:Blank()})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Highlighted
Community Support
Community Support

Re: Append Text Input to Multi Line Text Field on Edit Screen

Hi @marcgiag ,

Based on the needs that you mentioned, I think a collection could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

1.JPG

 

2.JPG

Set the OnSelect property of the "+" Icon to following:

Collect(NameEntry, TextInput1.Text);Reset(TextInput1)

 Set the Default Property of the Visitor Names (s) Text Box to following:

If(
   EditForm1.Mode = FormMode.New, // EditForm1 represents the Edit form in your app
   Concat(NameEntry, Value & Char(10)),
   Parent.Default
)

Set the OnVisible property of current screen to following:

Clear(NameEntry) // clear NameEntry collection

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best 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

Highlighted
Community Champion
Community Champion

Re: Append Text Input to Multi Line Text Field on Edit Screen

Hi @marcgiag ,

I believe both suggestions have the ability to address you issue. Please accept the one that helps the most.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (6,204)