Dynamic API Header Value Is Not Populating

Wappler Version: 3.3.6
Operating System: Mac OS Big Sur

Expected behavior

  1. A Server-Side API request responds with JSON data.
  2. Part of the Response Data from the server-side request is then dynamically set as an API header value in a client-side API request, and the request is sent.
    Screen Shot 2020-10-08 at 12.09.45 PM
  3. Request is successful

Actual behavior

  1. A Server-Side API request responds with JSON data.

  1. The response data is not populating within the header value and the request is returning as unauthorized.

Screen Shot 2020-10-08 at 12.03.56 PM

If I use the same value elsewhere, eg. display it on the page somewhere, that works fine. It just won’t populate in the API header value.

I also tried setting the value as a session variable, which works, but it, too, cannot be sent as an API Header value.

The API request is successful if I set the header value manually (hard code it), but the value will change for each session, so it needs to be dynamic.

Can you share the code view of the client-side API request?

Here is the code view:

Here is the setup in the API component:

Works just fine if I manually put in a value

Try removing the backticks form header value.

@Kohlmanndean did you ever figure this out? I’m having the exact same issue with input data attributes. Sending a string of the dynamic data value (as you were seeing) instead of actually pulling the data.

Hopefully you figured out what it was.

Hi,
This is still an issue - adding a dynamic header (in my case, set from a variable) doesn’t dynamically populate the request.

Additionally, I’m setting a customer header (“x-api-key”), and when I save the project, there is a space inserted in the header name so it becomes " x-api-key".

Andy

Was this answered? If yes, I wanna look at the solution, I was having the same problem. Thank you!