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.