Skip to content

customRowAction - setValue - Converts Line Break to String Literal Markup Break #10367

@majddadi

Description

@majddadi

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

None

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

SP Online - Work environment.

Describe the bug / error

When adding a new line '\r\n' or '\n', customRowAction seems to interpret that as a string literal <br //>

Snippet of the JSON formatting:
"action": "setValue",
"actionInput": { "field_1": "=[$field_1] + 'Action:' + '\r\n' +'Accepted' + ' - ' + [$field_2]",
"field_2": "" }

When manually typing into field_2 a text like the following:
Line 1
Line 2

The output of the setValue on field_1 will be:
Action:<br //>Accepted - Line 1<br //>Line 2

I tried other approacehs like <br //> or \n , etc. but all either failed or ended up literal string break

Steps to reproduce

  1. Create two multiline (Plane Text) columns. One as a draft (staging) column and another as the final output.
  2. Create a single line text column as button to trigger the update (trigger column). This is where the customRowAction parameter lives.
  3. Inside the trigger_column, set the value of the final ouput column as I showed earlier in the description

Expected behavior

I expect this to behave just like when using \r\n or \n inside the txtContent paramter, where they are actually treated as new lines.

Metadata

Metadata

Assignees

Labels

area:spfxCategory: SharePoint Framework (not extensions related)type:bug-confirmedConfirmed bug, not working as designed / expected.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions