Pipped text with created embedded data | XM Community
Solved

Pipped text with created embedded data


Userlevel 5
Badge +7

Hi 

I receive a field in my contact list named motivo1, it bring the reason why the person visited the website in a code (ex: SUP) using a json.

 

i would need to have a question with the pipped text of de decodification of this code (ex: download of the bill), i created a java script in the header of the survey that generates the embedded data field motivopregunta.

 

 

However when i put this as piped text it doesn't work, however in data and analysis i get the field filled with the right information. i am guessing it is because the field is created when the customer access the survey. Does any one has any idea of how can i make this work?

Thank you!

icon

Best answer by Nam Nguyen 2 September 2023, 06:07

View original

12 replies

Userlevel 7
Badge +20

@Erikahuer Do you have a Embedded field name “motivol” that get the field motivol in contact list?

 

Userlevel 5
Badge +7

@dxconnamnguyen  yes, i have a embedded data field for motivo1

Userlevel 7
Badge +20

@Erikahuer Did you piped-text show the field motivopregunta at the same block where you create it? If you do, try move it to different block or add a page break between those.

 

Userlevel 5
Badge +7

@dxconnamnguyen I tried with this method but i am still getting the same error :(

Userlevel 7
Badge +20

@Erikahuer If your embedded data is not empty in data & analysis, that’s all I can think of what might happened. You try to pip-text show it before or on the same page where you assign it’s value

Userlevel 5
Badge +7

@dxconnamnguyen 

 

i do get it in data and analysis, i have in the fisrt question of the survey 
This is the java.

Qualtrics.SurveyEngine.addOnReady(function() {
  var motivo1 = "${e://Field/motivo1}"; // Replace "motivo1" with your embedded data field name

  var motivopregunta = ""; // Initialize the Motivopregunta variable

  // Map the motivo1 values to Motivopregunta values based on the provided logic
  switch (motivo1) {
    case "SUP":
      motivopregunta = "la suspensión de líneas";
      break;
    case "REA":
      motivopregunta = "la reactivación de líneas";
      break;
    case "CSM":
      motivopregunta = "el cambio de SIM";
      break;
    case "CEQ":
      motivopregunta = "el cambio de equipo";
      break;
    case "CCH":
      motivopregunta = "el cambio de SIM y equipo";
      break;
    case "ADL":
      motivopregunta = "el reporte detallado de líneas";
      break;
    case "REC":
      motivopregunta = "el reporte de consumo de BM";
      break;
    case "RCC":
      motivopregunta = "el consumo después del corte";
      break;
    case "RDL":
      motivopregunta = "el detalle de llamadas";
      break;
    case "RFC":
      motivopregunta = "el reporte de Facturación y consumo";
      break;
    case "RRI":
      motivopregunta = "la solicitud del reporte de Roaming Internacional";
      break;
    case "RSA":
      motivopregunta = "la solicitud del reporte de Servicios adicionales";
      break;
    case "ADF":
      motivopregunta = "el registro de datos fiscales";
      break;
    case "DCF":
      motivopregunta = "la consulta de una factura";
      break;
    case "FSM":
      motivopregunta = "la solicitud de todas tus facturas";
      break;
    case "ECC":
      motivopregunta = "la búsqueda de Estados de cuenta";
      break;
    case "SEC":
      motivopregunta = "la generación de detalle de consumo por línea";
      break;
    case "ECM":
      motivopregunta = "la solicitud de todos los Estados de cuenta";
      break;
    case "FEQ":
      motivopregunta = "Consultar por número de factura";
      break;
    case "FET":
      motivopregunta = "la solicitud de todas tus facturas";
      break;
    case "CPE":
      motivopregunta = "la solicitud de factura de equipos";
      break;
    case "CPS":
      motivopregunta = "la solicitud de facturas de servicios";
      break;
    case "RAF":
      motivopregunta = "la solicitud de archivos F";
      break;
    case "RLE":
      motivopregunta = "la solicitud del análisis de llamadas externas";
      break;
    case "FAE":
      motivopregunta = "la solicitud factura electrónica";
      break;
    case "FPS":
      motivopregunta = "la solicitud de facturas pendientes de pago de servicio (DEUR)";
      break;
    case "CRP":
      motivopregunta = "la creación de referencia de pago (Servicios y/o equipos)";
      break;
    case "CAC":
      motivopregunta = "la creación de acceso";
      break;
    case "EAC":
      motivopregunta = "la edición de acceso";
      break;
    case "SAC":
      motivopregunta = "la suspensión de acceso";
      break;
    case "RAC":
      motivopregunta = "la reactivación de acceso";
      break;
    case "ELA":
      motivopregunta = "la eliminación de acceso";
      break;
    case "IAC":
      motivopregunta = "la edición de información";
      break;
    case "RDA":
      motivopregunta = "la alta de accionistas";
      break;
    case "BDA":
      motivopregunta = "la eliminación de accionistas";
      break;
    case "MDA":
      motivopregunta = "la modificación de accionistas";
      break;
    case "ESI":
      motivopregunta = "el cambio de SIM";
      break;
    case "ESQ":
      motivopregunta = "el cambio de eSIM y equipo";
      break;
    case "SEA":
      motivopregunta = "la solicitud de servicios adicionales sin costo";
      break;
    case "CMT":
      motivopregunta = "el control Móvil Telcel";
      break;
    case "SKM":
      motivopregunta = "el Sekur Messenger";
      break;
    case "PMD":
      motivopregunta = "el paquete de más datos";
      break;
    case "COT":
      motivopregunta = "la conferencia Telcel";
      break;
    case "AGL":
      motivopregunta = "la administración de grupos y líneas";
      break;
    case "DIR":
      motivopregunta = "el directorio";
      break;
    case "SET":
      motivopregunta = "el servicio técnico";
      break;
    default:
      motivopregunta = ""; // Set a default value if no match is found
  }

  // Set the Motivopregunta value to a new embedded data field
  Qualtrics.SurveyEngine.setEmbeddedData('Motivopregunta', motivopregunta);
});

 

Userlevel 7
Badge +20

@Erikahuer How do you pip-text it

${e://Field/motivopregunta} or ${e://Field/Motivopregunta}

Userlevel 6
Badge +39

Can you show your survey flow?

Are you trying to pipe it in the first question of your survey?

Userlevel 5
Badge +7

The question is the 3 one it is in a different block from the first question that is bringing the embedded data 

 

 

Userlevel 7
Badge +20

The question is the 3 one it is in a different block from the first question that is bringing the embedded data 

 

 

You’re code setting value to the embedded field Motivopregunta but your survey flow said motivopregunta and I guess you’re showing it as ${e://Field/motivopregunta}

@Erikahuer How do you pip-text it

${e://Field/motivopregunta} or ${e://Field/Motivopregunta}

 

Userlevel 5
Badge +7

Hi @dxconnamnguyen 

I am pipped it as ${e://Field/motivopregunta}, i changed the java to motivodepregunta and it is working now.

Thank you so much!

Userlevel 7
Badge +20

@Erikahuer Happy to help 👍

Leave a Reply