13
Views
11
Comments
Solved
How to add/append texts into List of Record variables?

I have List of Records variable and I want to put 2 texts ("DBA", "All") into the list of records using Assign.



Rank: #87
Solution

Hello there Wilbye,

Hope you're doing well.

You can simply use ListAppend System action:


For your scenario, you can do this:


By the way, I can see that you're creating a List of Record data type variable, where the Record has just a Text.

I suggest that you create a List of Text for your scenario instead (it is just simpler to work with), like this:


Then you can still use ListAppend action, but you don't need to expand your Element (like the image above) or create an extra Position Record do to this ListAppend. Since the Element is a Text itself, you can just do this:


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #87
Solution

Hello Wilbye,

Thank you for giving this context.

If you are using this List in a Combo Box, you'll need indeed to have a List of Record (Text), otherwise you won't be able to specify the Source Attribute property of the Combo Box.

Therefore, your changes are correct now :)


You just need to click in the "Expand Element" button and place your desired values there when you are working with a List of Record variable. If the record is complex (for example, a struture with many fields), you can create a variable just for that Record and use that Record in the ListAppend.

For your example it would be something like:

Then an assign with the values that you pretend (for the element that you want to append to the list):

And the ListAppend in the end (append Position element to PositionOption list):


This was just an example that you should use when you have complex Records (instead of just a Text). It may help you in the future :)


Kind regards,

Rui Barradas

Rank: #87
Solution

Hello there Wilbye,

Hope you're doing well.

You can simply use ListAppend System action:


For your scenario, you can do this:


By the way, I can see that you're creating a List of Record data type variable, where the Record has just a Text.

I suggest that you create a List of Text for your scenario instead (it is just simpler to work with), like this:


Then you can still use ListAppend action, but you don't need to expand your Element (like the image above) or create an extra Position Record do to this ListAppend. Since the Element is a Text itself, you can just do this:


Hope that this helps you!


Kind regards,

Rui Barradas

Hi WilBye,

You need to use the ListAppend() action which you need from System via Manage Dependencies.
Then you can use it in two ways as shown below:

1st.

2.

Hope this helps,

Thank you and kind regards,

Chris

Thank you for the response guys, mine doesn't show the "Position" under element

Rank: #87

Hello Wilbye,

You have to click "Expand Element":


Kind regards,

Rui Barradas

Don't mind my last message. I changed my List of Records into List of Text but now I'm having issues when I compile.Does this has something to do with what we did?

Rank: #87

Hello Wilbye,

Can you share your changes?


Kind regards,

Rui Barradas

Hi Rui, I think I found the issue, it's when I changed the List of Records into List of Text, I'm actually using the list for a Combo Box, I reverted the List from List of Text into List of Records (Text) for it to have the required fields for the combo box and also did the Extend Element for me to put the value there.


Rank: #87
Solution

Hello Wilbye,

Thank you for giving this context.

If you are using this List in a Combo Box, you'll need indeed to have a List of Record (Text), otherwise you won't be able to specify the Source Attribute property of the Combo Box.

Therefore, your changes are correct now :)


You just need to click in the "Expand Element" button and place your desired values there when you are working with a List of Record variable. If the record is complex (for example, a struture with many fields), you can create a variable just for that Record and use that Record in the ListAppend.

For your example it would be something like:

Then an assign with the values that you pretend (for the element that you want to append to the list):

And the ListAppend in the end (append Position element to PositionOption list):


This was just an example that you should use when you have complex Records (instead of just a Text). It may help you in the future :)


Kind regards,

Rui Barradas

Rank: #297

HI Wilbye

You have to click expand button. Please refer to the image attached.

Kind Regards,


Expand.jpg

Thank you for this Tom Zhao

Thank you for the response guys, issue solved.