Help! How to assign a specific value from a webhook to a variable correctly!?

:bullseye: What is your goal?

I want to assign the value “Dog1” to the variable “friend1_name”

:thinking: What is the problem?

The scenario runs, but the variable ends up assigning

“{“response_text”:“Dog1”}” instead of just “Dog1”, which causes not valid Json in the next step.

When I try to to manipulate the text, e.g., with replacing/deleting parts of the string, I instead end up with an empty variable.

How should I do this?


What you’ve mapped into the Variable Value is a collection.

You need to select one step deeper, response_text instead of just the collection containing it.

If you are unable to get the correct array item consistently, you’ll need to learn how to use the “map” and “get” functions.


You can use the built-in functions map and get to access variables within an array.

To do this, you can use the built-in function map

{{ map(complex array; key; [key for filtering]; [possible values for filtering separated by a comma]) }}

and the built-in function get (or first) —

{{ get(object or array; path) }}

so you get something that looks like this —

{{ first(map(1.questions; "answers_given.1.response_text"; "answers_given.question_text"; "Friends' NAME")) }}

(Make Input Markup: Copy-paste the above into the field, including start/end curly brackets for it to import as intended)

For more information, the function’s documentation can be found in the Help Centre and the “Mapping with Arrays” link below. You should also complete the tutorials in the Make Academy, especially Using get() and map() functions.

I’d recommend going through the Make Academy if you haven’t yet!

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Learn Make

How-Tos

Hope this helps! If you are still having trouble, please provide more details.

@samliew

The addition of response_text did the trick! See attached example!

Thanks @samliew!

1 Like

No problem, glad I could help with your question:
"Help! How to assign a specific value from a webhook to a variable correctly!?"   :tada:

1. Which was the most helpful post in this thread?

The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep this forum organised. :folded_hands:

This marks the topic as solved, so that others can:

  • save time when browsing the latest activity on the forum, and
  • quickly jump to the solution in this topic (from the top)

To do this, simply click the checkbox at the bottom of the post that is the most helpful in answering your question.

a screenshot of post menu options at the bottom of each post
Note: :light_bulb:
:link: Here’s a magic link to a list of your other “unsolved” topics— status:unsolved

2. Have you learnt something new?

Do bookmark this topic so you can easily find and return to this topic in future.

a screenshot of bookmark link at the bottom of the topic

Note: :light_bulb:
:link: Here’s a magic link to a list of your bookmarks— /my/activity/bookmarks

3. Have a different question? Start a new topic.

Do you have a question that is not about "Help! How to assign a specific value from a webhook to a variable correctly!?"? Please start a new topic.

Creating a new topic for each question makes it easier for others with the same problem to search for answers. You are also more likely to receive help sooner as new topics are displayed first on the forum’s “new” page!

@samliew