Get the value of a list (activity) for self-hosted Bitrix24

Get the value of a list (activity) for self-hosted Bitrix24

938

This solution allows to return a text equivalent of the infoblock list value.

Attention! This activity works only with Business Process Designer.

This solution is developed only for working with the list fields of infoblocks. Some custom fields, based on the field with type «List» (for example, field «Binded list (MCArt)»), instead of a text equivalent, returns its ID, which is not inconvenient for using in the business process.

To get a text equivalent you may use this tool.

It works this way:

— it takes the infoblock ID, ID of the list value and mnemonic code of the list field (If the mnemonic code is missing, it will not work);

— we get a text equivalent of the value.

Example of sharing use with the module "Dependent fields in lists".

Let's consider an example with a choice of marks of cars.

We’ve created a list “Dependent fields”.

1.jpg

Let's consider its fields.

2.jpg

The field "Name" is standard.

The field "Mark" — type “List”.

3.jpg

Includes three marks of cars for selection.

4.jpg

The field "Model" — type “Binded list (MCArt)” — created with the help of the solution “Dependent fields in lists”. Binded with the field "Mark".

5.jpg

For each value of the field "Mark" few values for the choice are available.

6.jpg

7.jpg

Now consider the scheme of the business process.

8.jpg

9.jpg

The business process has one variable of type String — "Model".

10.jpg

1 step. We get the text value of the field "Model" with the help of activity "Get the value of a list".

11.jpg

Infoblock ID — it’s an ID of our infoblock "Dependent fields".

12.jpg

List item ID — select the field "Model".

13.jpg

Property code — it’s a mnemonic code of the field "Model".

14.jpg

2 step. Write the resulting value to the variable "Model".

15.jpg

3 step. We send the standard notification to the user with the text "You have selected a mark" — and next the substitution from the field "Mark" + returned value, received by the activity (Model).

16.jpg

17.jpg

18.jpg

4 step. We check the condition — is this model "Pajero" or not.

19.jpg

5 step. Depending on whether the condition is fulfilled or not (Yes — Pajero, No — another model), the user will get a notification.

If Pajero — “Cool car”.

20.jpg

If not — “It is not Pajero”.

21.jpg

Now we will add a new element (not Pajero).

22.jpg

We receive the message — selected mark, model and text, specified in the “No” case of the business-process.

23.jpg

Now we will create a new element — Pajero.

24.jpg

We receive the message.

25.jpg