Saving contact name from WhatsApp Broadcast Help Center May 18, 2023 23:04 Updated Index: How to save contact name in block? How to create a script in block? The configuration must be done before the Broadcast is triggered in the chosen block for the user to reach your stream.A Define Contact must be inserted in the block in the output actions. With this action it will be possible to save the names of the clients in the contact base.By default, the user arriving via the WhatsApp channel has the user's name and phone number. To save the name we will use the variable contact.name. To save the phone we have this example documented here Saving the WhatsApp contact phone. How to save contact name in block? 1. Example saving the contact's name in the Outbound Actions of the chosen block using the sending of active messages Plugin Broadcast: 2. Example Saving the contact's name using the data filled in by sending a spreadsheet in the Broadcast plugin,as directed below: When entering the name of the contact in the Broadcast sending spreadsheet, it is possible to use the information and save the name. When we trigger, the name field is saved in the extras of the contact. Sheet name field: In the block of your flow chosen for the user to arrive after sending the Broadcast, we will use the variable {{contact.extras.name}} and define the contact in the block's output actions: After defining the contact, the user name is saved in the BLIP contacts. 3) Example to save updated contact name from WhatsApp Broadcast If this user returns again via Broadcast, the name of the phone contact can be different and when sending an active Broadcast message, the user keeps the previous name already saved. In the example below we have a procedure to update this contact name. How to create a script in block? In the block where the user arrives in the flow, the following settings will need to be made: In the output actions of the block, it will be necessary to create a script that will receive the contact.identity as an input variable and in the output variable create a variable called telAdjusted as shown in the image below: The script will be as follows: function run(identifier) {var phoneUser = identifier.split("@")[0];return phoneUser;} After this step, we're going to create an http request, using the following parameters: Method: Post URL : https://msging.net/commands Headers Authorization with value equal to Bot's Key (If it has a router, must use its key) Content-Type with value equal to application/json The body of the request should look like: {"id": "{{$guid}}","to": "postmaster@wa.gw.msging.net","method": "get","uri": "lime://wa.gw.msging.net/accounts/{{telAdjusted}}"} Note: If the script output is done in a variable other than telAdjusted, also change the body of the request. Save the request body in a variable called return, as shown in the image below: Once this is done, just create an action to define contact, where the value {{return@resource.fullName}} will be passed in the name field, as shown in the image: For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles How to save a contact's WhatsApp number Sending WhatsApp Active Messages on Blip Desk Audience file configuration - Bulk notification sending DAU - Daily Active User How to fill out the WhatsApp Activation form