[
{
"clauseId": 1,
"clauseName": "cover",
"texts": [
{
"textId": 1,
"text": "hello"
}
]
},
{
"clauseId": 3,
"clauseName": "xyz",
"texts": [
{
"textId": 3,
"text": "hello Everyone"
},
{
"textId": 4,
"text": "Some data"
}
]
},
{
"clauseId": 2,
"clauseName": "joining",
"texts": [
{
"textId": 3,
"text": "hello1"
},
{
"textId": 4,
"text": "hello2"
}
]
}
]
If I create a list like
a=[joining,cover]
I expect a new list to be generated as
b=[hello1,hello2,hello]
It's important to note that the index of each element matters. If I reverse the index, the
b =[hello,hello1,hello2]
If
a=[xyz,joining,cover]
b=["hello Everyone","Some data",hello1,hello2,hello]
Similarly, if I change the order in list 'a' to [joining,xyz,cover]
b=["hello1","hello2","hello Everyone","Some data",hello]
It should be noted that the input data may include multiple clause names and text entries. This is just a demonstration.