cancel
Showing results for 
Search instead for 
Did you mean: 

Pass Response Header into App variable doesn't work

Andreas_Kramer
Explorer
0 Kudos

Hi community,

I currently trying to get an x-csrf-token into an app variable.
This is how I setup my project:

a) Data variable pointing to a SAP BTP destination providing the CSRF Token

b) Button on canvas that triggers logic flow

c) Logic flow using "Get record" to fetch the token and pass it on to a 'toast'

Problem statement:
While the token was successfully fetched during the 'test' in the data variable itself. It seems that the logic flow is not able the receive the token.

Data Variable:

The token seems to be successfully received during the test.

Logic Flow:

Here is the result:

Your input and support is highly appreciated.

Venkat_Vyza
Active Participant
0 Kudos

Hi @andreas_kramer_xx,

What sort of API/OData Service is this Destination pointing to? I'm asking because we don't need to create a separate BTP Destination for fetching the CSRF token. And, I also see that you added X-CSRF token under the Resource Schema in the Base.

Thank you,

Venkat Vyza

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Can you let us know, using Developer Tools, if the issue is that the token is not returned in the response during runtime (forget about the test), or that the token is not placed inside the schema?

View Entire Topic
Andreas_Kramer
Explorer
0 Kudos

Update:

The changed to { record: PICK_KEYS(response.headers,["x-csrf-token"]), driverCode: response.status }
finally worked after cleaning the cache.

Thanks a lot for your help.
May I ask to add the "record" and "Pick Keys" methods to the official help?

Dan_Wroblewski
Developer Advocate
Developer Advocate

I will let the development people about your request (I am not connected with them in any way, except we both work for SAP).

The response mapper functionality is not very well documented at all, and I think the whole data resource functionality -- especially OData -- will be updated soon, but I do not know exactly what they are planning.

If my help helped, please accept it -- in both questions 🙂