Applying a hash function to embedded data during data collection: possible? | XM Community
Skip to main content
Question

Applying a hash function to embedded data during data collection: possible?

  • February 28, 2024
  • 5 replies
  • 351 views

Forum|alt.badge.img

Dear Community,

is there any way to apply a (cryptographic) hash function to embedded data, server-side, during the survey flow? I.e., the user inputs something, I do some calculations on that data, then transform it using said hash function, then show it back to the user. It is important that the user can not see which function is applied, i.e. it is not an option to do the hashing in the user’s browser in JavaScript.

Unfortunately, I did not see such a possibility when scanning the options, but perhaps (hopefully) there is someone here knowing the tool better.

It seems that it is (a) possible to do basic arithmetic operations server-side using piped text / the $e{ }-operator, but nothing more involved and very little string manipulation (apart from bucketing and concatenation). (b) Possible to manipulate embedded data in JavaScript, but this will always run client-side. (c) Actually apply a MD5 function to embedded data (which would be totally what I need) as a transformation, however, these transformation can only be applied at the stage of data export, not during ongoing collection, so that the result could be shown back to the user. [https://www.qualtrics.com/support/xm-discover/connectors/transforming-data/applying-transformations/]

Is this correct and what I would like to do not possible, or am I misunderstanding anything / overlooking some option?

Thank you in advance!

David

5 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2050 replies
  • February 28, 2024

You could use a lambda function with the web service block to do this.


Forum|alt.badge.img+1
  • 2 replies
  • March 5, 2024

You could use a lambda function with the web service block to do this.

@ahmedA Could you offer an example of what this would look like?

 


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2050 replies
  • March 5, 2024

Please see this: https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html

Drop me a PM if you need assistance.


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2050 replies
  • March 5, 2024

Forum|alt.badge.img+1
  • 2 replies
  • March 6, 2024

The solution I ended up using was to send the embedded data via an API call to a hasher (hashify.net) using Web Service.