# Optional sequence\<NameValue\> parameters?

**URL:** <https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024>\
**Category:** Forum\
**Tags:** analytics, Streaming-Analytics-Apama\
**Created:** [February 19, 2025, 12:20pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024 "2025-02-19T12:20:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)\
**Post date:** [February 19, 2025, 12:20pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/1 "2025-02-19T12:20:40Z")

</div>

Hi,

in a custom block to invoke an HTTP endpoint, we want to give users to option to provide additional headers for the request using a sequence parameter. This should be optional but when activating a model, we get an error about a mandatory parameter missing.

We tried using optional\< sequence \> but in that case we only get a single text field instead of an extensible list of name-value fields.

My understanding from the documentation is that “optional” should work in this case as well:

> <https://github.com/Cumulocity-IoT/apama-analytics-builder-block-sdk/blob/main/doc/040-Parameters.md>

Is that a misunderstanding?

---

<div class="post-metadata">

**Author:** ![Sudha\_Jallu](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/sudha_jallu/32/31978_2.png) [@Sudha\_Jallu](https://community.cumulocity.com/u/Sudha_Jallu)\
**Post date:** [February 19, 2025, 2:42pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/2 "2025-02-19T14:42:29Z")

</div>

Hi Herald,  
Yes, this should work.

I have tested with **Range Lookup** block by adding one more parameter  
**optional\<sequence\<eventWithPairOfFeilds\>\> testRanges**.  
I can see it is taking as list.

**output of block with new param**  
test ranges are present [apama.as.NV(“5.0”,any(string,“bla”)),apama.as.NV(“15”,any(string,“blabla”))]

Thanks,  
Sudha Jallu

---

<div class="post-metadata">

**Author:** ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)\
**Post date:** [February 19, 2025, 2:43pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/3 "2025-02-19T14:43:42Z")

</div>

ok, let us retest that again.

---

<div class="post-metadata">

**Author:** ![Marvin\_Fecke](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/marvin_fecke/32/32111_2.png) [@Marvin\_Fecke](https://community.cumulocity.com/u/Marvin_Fecke)\
**Post date:** [February 19, 2025, 3:04pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/4 "2025-02-19T15:04:09Z")

</div>

Hi,  
I tried it again

I configured the headers parameter like this

```auto
	/**
	* Headers.
	*
	* Additional Headers to add.
	* @$displayType List of Header Key and Header Value
	* @$displayHeaderName Header Key
	* @$displayHeaderValue Header Value
	* @$minNumEntries 0
	*
	*/
	optional<sequence<NameValue>> headers;

```

But the block looks like this:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/b/e/bee0ef1c23070d494f5a1bb245b679cbf31296f2.png)

It looks like an usual text field and not like a sequence for Name Values.

---

<div class="post-metadata">

**Author:** ![Sudha\_Jallu](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/sudha_jallu/32/31978_2.png) [@Sudha\_Jallu](https://community.cumulocity.com/u/Sudha_Jallu)\
**Post date:** [February 19, 2025, 3:09pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/5 "2025-02-19T15:09:32Z")

</div>

Let me try from UI too.

---

<div class="post-metadata">

**Author:** ![Sudha\_Jallu](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/sudha_jallu/32/31978_2.png) [@Sudha\_Jallu](https://community.cumulocity.com/u/Sudha_Jallu)\
**Post date:** [February 20, 2025, 11:19am UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/6 "2025-02-20T11:19:22Z")

</div>

Hi,

Yes you are right, It is not allowing from the UI.  
I will create defect and also see if there is any workaround for this.

Thanks,  
Sudha Jallu.

---

<div class="post-metadata">

**Author:** ![Sudha\_Jallu](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/sudha_jallu/32/31978_2.png) [@Sudha\_Jallu](https://community.cumulocity.com/u/Sudha_Jallu)\
**Post date:** [February 21, 2025, 12:42pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/7 "2025-02-21T12:42:12Z")

</div>

Hi,

I’m afraid there is no workaround available.

We will get back to you as we investigate further.

Could you share the platform details you are using ?

Thanks,  
Sudha Jallu.

---

<div class="post-metadata">

**Author:** ![Vinod\_Kumar2](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@Vinod\_Kumar2](https://community.cumulocity.com/u/Vinod_Kumar2)\
**Post date:** [February 27, 2025, 12:24pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/8 "2025-02-27T12:24:06Z")

</div>

Hi Harald,  
The issue has been fixed, and the fix is now available in the public block-sdk Git repository ( [Cumulocity-IoT/apama-analytics-builder-block-sdk: Apama Analytics Builder Block SDK](https://github.com/Cumulocity-IoT/apama-analytics-builder-block-sdk)) as part of version 26.48.0.

Thanks & Regards,  
Vinod

---

<div class="post-metadata">

**Author:** ![Marvin\_Fecke](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/marvin_fecke/32/32111_2.png) [@Marvin\_Fecke](https://community.cumulocity.com/u/Marvin_Fecke)\
**Post date:** [February 27, 2025, 2:56pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/9 "2025-02-27T14:56:33Z")

</div>

Hi

I also tried it and it is looking fine now.  
Thank you for your help.

---

<div class="post-metadata">

**Author:** ![Harald\_Meyer](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harald_meyer/32/1959_2.png) [@Harald\_Meyer](https://community.cumulocity.com/u/Harald_Meyer)\
**Post date:** [February 28, 2025, 2:57pm UTC](https://community.cumulocity.com/t/optional-sequence-namevalue-parameters/8024/10 "2025-02-28T14:57:16Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
