# Arcscript: How do I put a linefeed in an attribute?

**URL:** <https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627>\
**Category:** CData Arc\
**Tags:** question\
**Created:** [February 13, 2024, 12:21pm UTC](https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627 "2024-02-13T12:21:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![russell-jerseypost](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@russell-jerseypost](https://community.cdata.com/u/russell-jerseypost)\
**Post date:** [February 13, 2024, 12:21pm UTC](https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627/1 "2024-02-13T12:21:14Z")

</div>

I want to do something like this

\<arc:set attr=“scope”\>[encodedurl] **\n** [expiry]\</arc:set\>

I have tried using a multiline arc:set but without any luck

\<arc:set attr=“scope”\>  
&nbsp; [encodedurl]  
&nbsp; [expiry]  
\</arc:set\>

Any ideas?

---

<div class="post-metadata">

**Author:** ![James\_B](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/james_b/32/1688_2.png) [@James\_B](https://community.cdata.com/u/James_B)\
**Post date:** [February 13, 2024, 7:02pm UTC](https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627/2 "2024-02-13T19:02:48Z")

</div>

What context are you using the new scope attr in? Both of those statements will use a new line in the resulting value, which you can see if you test it in a Script connector for example:

```xml
<arc:set attr="encodedurl" value="http://someurl/" /><arc:set attr="expiry" value="2020-01-01" /><arc:set attr="scope">[encodedurl]\n[expiry]</arc:set><arc:throw code="x" desc="[scope]" />

```

You can see the line break in the thrown exception:

![2f0a9eff-9731-4bcb-be54-c8999b1ecf19.png](https://us1.discourse-cdn.com/cdata/original/2X/9/909acc29d3e94b9f9606d3e35b5d7b754e786087.png)

And in the second case, you get the preceding and following line breaks:

```xml
<arc:set attr="encodedurl" value="http://someurl/" /><arc:set attr="expiry" value="2020-01-01" /><arc:set attr="scope"> [encodedurl] [expiry]</arc:set><arc:throw code="x" desc="[scope]" />

```

![24c76620-29c0-4978-8329-fc46112941fa.png](https://us1.discourse-cdn.com/cdata/original/2X/9/9c67fb668d5ae6136953f9ab130eca22960d1dd4.png)

Of course, the context from which scope is evaluated is important here, because the exception here supports multiline data.

---

<div class="post-metadata">

**Author:** ![russell-jerseypost](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@russell-jerseypost](https://community.cdata.com/u/russell-jerseypost)\
**Post date:** [February 14, 2024, 10:41am UTC](https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627/3 "2024-02-14T10:41:16Z")

</div>

I’m using the scope and encoding it using HMACs.

I then pass it in the message header to a REST connector and use it in a HTTP Header

 ![1d138afa-de52-41c2-8531-d3ee60d7eab3.png](https://us1.discourse-cdn.com/cdata/original/1X/f4c472e755f5ec1f79fedda6392495393d2017dd.png)

The REST Connector log shows these two headers being evaluated correctly.

Very similar to&nbsp;[https://arc.cdata.com/kb/articles/arc-http-signature-auth.rst](https://arc.cdata.com/kb/articles/arc-http-signature-auth.rst)

Here’s my script

```xml
<arc:set attr="encIn0.data" value="[url]" /><arc:set attr="encIn0.format" value="URL" /><arc:call op="encEncode" in="encIn2" out="result0"> <!-- setting the output file data to be the encoded data returned from the operation --> <arc:set attr="output.encodedurl">[result0.encodeddata]</arc:set></arc:call><arc:set attr="fixedtimestamp" value="03-02-2024"/><arc:set attr="expiry">[fixedtimestamp| todate('dd-MM-yyyy','U') |dateadd('day', 7)|datediff('second', '1970-01-01 00:00:00Z')]</arc:set><arc:set attr="scope">[output.encodedurl]\n[expiry]</arc:set><arc:set attr="encIn.data" value="[scope]" /><arc:set attr="encIn.format" value="HMAC" /><arc:set attr="encIn.hmackey" value="[azureprimary.key]" /><arc:set attr="encIn.hmacalgorithm" value="SHA" /><arc:set attr="encIn.hmacbits" value="256" /><arc:set attr="encIn.outformat" value="BASE64" /><arc:call op="encEncode" in="encIn" out="result"> <!-- setting the output file data to be the encoded data returned from the operation --> <arc:set attr="output.hashb64">[result.encodeddata]</arc:set></arc:call><arc:set attr="encIn2.data" value="[output.hashb64]" /><arc:set attr="encIn2.format" value="URL" /><arc:call op="encEncode" in="encIn2" out="result2"> <!-- setting the output file data to be the encoded data returned from the operation --> <arc:set attr="output.signatureUrlEncoded">[result2.encodeddata]</arc:set></arc:call><arc:set attr="sigheader">SharedAccessSignature sig=[output.signatureUrlEncoded]&se=[expiry]&skn=sas-tracking-events-topic&sr=[output.encodedurl]</arc:set><arc:set attr="outfile.FilePath" value="[FilePath]" /><!-- debug --><arc:set attr="outfile.Header:expiry">[expiry]</arc:set><arc:set attr="outfile.Header:scope">[scope]</arc:set><arc:set attr="outfile.Header:signature">[output.hashb64]</arc:set><!-- debug end--><arc:set attr="outfile.Header:sigheader" value="[sigheader]" /><arc:set attr="outfile.Header:brokerProperties">{"SessionId":"[guid()]"}</arc:set><arc:push item="outfile" />

```

---

<div class="post-metadata">

**Author:** ![russell-jerseypost](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@russell-jerseypost](https://community.cdata.com/u/russell-jerseypost)\
**Post date:** [February 14, 2024, 11:16am UTC](https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627/4 "2024-02-14T11:16:12Z")

</div>

The issues is with

```xml
<arc:set attr="encIn0.data" value="[url]" /><arc:set attr="encIn0.format" value="URL" /><arc:call op="encEncode" in="encIn0" out="result0">  <!-- setting the output file data to be the encoded data returned from the operation -->  <arc:set attr="output.encodedurl">[result0.encodeddata]</arc:set></arc:call>

```

It’s encode //:, = etc to lowercase (%2f, %3d etc).&nbsp; I’m comparing this with Postman and Crypto JS which encodes to uppercase (and works)

---

<div class="post-metadata">

**Author:** ![russell-jerseypost](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@russell-jerseypost](https://community.cdata.com/u/russell-jerseypost)\
**Post date:** [February 14, 2024, 12:43pm UTC](https://community.cdata.com/t/arcscript-how-do-i-put-a-linefeed-in-an-attribute/627/5 "2024-02-14T12:43:48Z")

</div>

All solved and working now

> **[How to Authenticate with Azure Service Bus - SOLVED | Community](https://community.cdata.com/cdata-arc-48/how-to-authenticate-with-azure-service-bus-solved-726)**
>
> Use this script before your REST connector https%3A%2F%2Fyour-sb-resource-name.servicebus.windows.net%2Fyour-topic\[now(unix)|add(604800)\] &l...
