Convert List to List Record
Question
Service Studio Version
11.10.9 (Build 38644)

Hi,

Is there any way to convert a List Text to a List Record Text without having to loop over every list item and creating a record object and appending them to the List Record?

Kind regards,

Bo

Hi,


did you already tried to use the "ListAppendAll" widget? Maybe with that you can append all at once and map the correct source attribute to the desired one:


Hope this can help.


Best regards,

Ricardo M Pereira

Hi,

Thanks for your response.

I tried this but without success. I'm not getting the record mapping in the ListAppendAll. It only appears when you go from Record List to List. But not from List to Record List.

I've included an image. In the image you can see Certs and Certifications2. Certs = Text Record List and Certifications = Text List. As you can see in the message I'm not able to map the Text List into the Text Record List.

Regards,

Bo

afbeelding20210304101124.png

Hello Bo Menick,

Yes it is possible first you create the record list of your parameter and used ListAppendAll in the action where you want to append . ListAppendAll required to parameter list and source list ,list parameter means where you need to add the list so it will be your record list and source list means your normal list . It will also ask for the mapping, due to change of data type so mapped the values. Hope it will solved your problem

Regards,

Akshay Deshpande.

Hi Akshay,

Thanks for your response.

As you said, "due to change of data type so mapped the values." I also thought it was like that. But I'm not getting the mapping. Can you tell me how you did it?

Kind regards,

Bo

can you send me OML so that It will help you to solved your problem. For reference I m attaching one screen shot.May be this will help you 

I think when we convert from record list to list it will ask for mapping but when we convert list to record list it is directly give to source list as I shown in the fig. 

Best Regards,

Akshay Deshpande.


mvp_badge
MVP

Bo Menick,

is that possible for you to share the sample oml.

Regards,

Manish Jawla

mvp_badge
MVP

Hi Bo Menick


I have attached the sample oml for your use case hope this helps.

Regards,

Manish Jawla

RecordlistMapping.oml

Hi Manish,

Thank you for looking into this.

This is unfortunately the wrong way. I want it from List to List Record and not the other way as the way you showed in your oml gives me the ability to map the List Record to the List.

In my case I want specifically a List Text to a List Record Text. Because the input parameter can't change unless you can map data from a REST call upon receiving.

Regards,

Bo

Why do you want to convert without looping? 

Because you can do it the one way, but not the other way. And if there is a way to append them all at once or convert it at once. It should be faster than looping over every text in the list and creating a temporary object and appending it to the list record.

Hi Manish,

I couldn't share my oml. So I recreated the problem in a new module. I've created two server actions. One with the problem and the other one with the current alternative solution.

Kind regards,

Bo

ListToListRecordTest.oml

Hello Bo Menick,

I m also attached the OML for reference please check this will help you to resolved your Problem.

Thanks and regards,


PS. As you said you need to convert from list to record list so In that case you need to set source list as a normal list because source list means the list from we add the list to another list for better understanding i m putting this image .

so you need to set the Parameter as i gave in the OML.

Regards,

Akshay Deshpande

Forumtest.oml

Hi Akshay,

Thanks for your quick response.

I've downloaded your oml and checked it out. There is a difference between your input parameter and mine. You're using a Record with Text and Integer attribute and I'm using a List Text. You could see the difference in the povided image. That is also the reason why it doesn't work for me what you showed in the oml. Also for me there is not a way to change the input parameter as it comes from an outside REST call unless there is a way to map the List Text to a List Record Text upon receiving it from the REST call.

Regards,

Bo

inputdiff.png

Ok you can still do that create one structure and in that structure add one attribute namely as "Text".

and change the data type of your list from text list to that structure list. for reference i m attaching the same OML as you send with the changes and when will need to set input set through mapping it.  

ListToListRecordTest.oml

So I'm not sure about it but maybe it works

you can create extension and use this code for your issue.

https://stackoverflow.com/questions/11162361/c-sharp-liststring-to-listobject-conversion

This looks very promising. I will look further into this later on. Thanks in advance.

I already try it. Unfortunately, Integration studio does not support the text list data type.

If I have any idea, I will update you :D

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.