How to merge an array and an element in a single array | Community
Skip to main content
esalraz
New Participant
May 6, 2024
Solved

How to merge an array and an element in a single array

  • May 6, 2024
  • 2 replies
  • 1121 views

Hello, 

 

I have an array with two elements and another field with an element (1) and I´d like to merge both in a single array I mean, an array which contains three elements. Could you help me and tell me which module and/or function will do that for me?

 

I attach a screenshot.

 

Thank you 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Richard_Le_

Hi,

 

I would use a set variable module and utilise use the add function. The syntax for the add function is:

 

add(array;value 1;value 2)

 

So in your example it would look something like:

 

add(DE:Assets Inventory - Antenna;DE:Assets Inventory - Baseband)

 

Best Regards,

Rich.

 

 

2 replies

lgaertner
New Participant
May 7, 2024

Hello esalraz,

 

You just need to use the merge() function.

 

merge(array1; array2; ...)

 

Regards

Lars

esalraz
esalrazAuthor
New Participant
May 7, 2024

Thank you @lgaertner 

Richard_Le_Accepted solution
New Participant
May 7, 2024

Hi,

 

I would use a set variable module and utilise use the add function. The syntax for the add function is:

 

add(array;value 1;value 2)

 

So in your example it would look something like:

 

add(DE:Assets Inventory - Antenna;DE:Assets Inventory - Baseband)

 

Best Regards,

Rich.

 

 

esalraz
esalrazAuthor
New Participant
May 7, 2024

Thank you @richard_le_