Live Helper Chat support forum.. Old google groups forum can be found here

You are not logged in.

Announcement

#1 2021-11-01 14:22:45

camalau
New member
Registered: 2021-04-01
Posts: 5

Transform collected value in collect custom attribute to Sub URL in Re

Hello everybody! I have the following situation, I have a menu

1 For products
2 for services

Today when the customer types 1 I capture through "collect custom attribute" number 1, I would like to transform this value into "products" to be able to pass it to "Sub URL" in "Rest API Calls" without forcing the user to type "products"

Thank you

Offline

#2 2021-11-01 14:57:11

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 3,926
Website

Re: Transform collected value in collect custom attribute to Sub URL in Re

Hi, welcome in the live helper chat forum.
The developer can be busy and take time to reply here.

You can always look at the official documentation or you can even find more support option in my forum signature.


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

#3 2021-11-01 15:07:07

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,544
Website

Re: Transform collected value in collect custom attribute to Sub URL in Re

you can access any url from chat even in sub url field. https://doc.livehelperchat.com/docs/bot … -variables

You need those

```
{{lhc.add.<additional variable key/identifier>}} - these values you are passing additionaly. It's either Field identifier from Start a chat form settings > Custom fields or if you are passing manually it's name attribute. If you put Field identifier value as gender in Start a chat form settings > Custom fields. In Rest API Call you can access this field like {{lhc.add.gender}}
{{lhc.var.<chat variable key>}} - these values can be set using extensions etc. It's data is taken by json_decode function from chat_variables column value. This column stores JSON as {<key> : <value>,..}. Usually in this column extensions stores their own data.
```

Offline

#4 2021-11-01 17:57:43

camalau
New member
Registered: 2021-04-01
Posts: 5

Re: Transform collected value in collect custom attribute to Sub URL in Re

Guys, I think I expressed myself wrong.

I have a menu where the customer must type 1 for option 1, 2 for option 2.

1 - Car
2 - Motorcycle

When I use the Collect custom attribute component it captures everything OK, including it sends what the customer typed, example. 1 or 2, what I need is to somehow modify the number 1 that he typed for car and the number two that would be motorcycle, because that's how the destination API understands, car or motorcycle and I didn't want to have to force the client driving car or motorcycle.

So what I need is to change the heat from

{lhc.add.type} = 1 to = car
{lhc.add.type} = 2 for motorcycle

without the customer having to type anything more than 1 or 2.


Thanks

Offline

#5 2021-11-01 18:13:04

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,544
Website

Re: Transform collected value in collect custom attribute to Sub URL in Re

I ques you can have on visitor text another trigger to be executed which would check is it 1 or 2.

So if condition is matched and it's 1 exeute one request if 2 execute another or just set another variable. like type_api etc smile
https://doc.livehelperchat.com/docs/bot … conditions

Offline

Board footer