1

Here is my payload:

[{User_Feedback=Satisfied with Amelia response, Record_Creation_Time=1505848950000, User_Name=Bora Karisma, Conversation_ID=10, ConverstaionStart_dt=1505848930000, Elapsed_Time=20, Status=Failed, idsid=kbora, Record_Update_Time=1505848950000, Goal_Modified=false, Domain_Name=Testing, Classifier_Name=HotSpot_classifier, Goal_Name=HotSpot, Last_user_Utterance=Help needed to connect hotspot?, Conversation_txt=Hotspot connection failed and amelia is not able to provide solution , BPN_Name=HotSpot_BPN, ConverstaionEnd_dt=1505848950000}]

I want to access the key and value in an expression so that I can form a dynamic sql query for inserting into DB.

From the expression evaluator I am only able to access the key's value by :

#[payload[0].ConverstaionEnd_dt]

but I don't want to mention the name of the field. Is it possible to access the keys and their values inside for loop in the expression component of mule, so that I can traverse the array and then choose only field that has some value and make a dynamic SQL query.

Help is highly appreciated.

Thanks Dhanjeet

SDE
  • 85
  • 1
  • 13
  • Please check this link and let us know if that resolves for you.. https://stackoverflow.com/questions/33173832/mule-creating-dynamic-where-condition-for-sql-query-through-db-connector – Mahesh_Loya Oct 27 '17 at 15:11
  • thanks for the input Mahesh, but it din't help me. – SDE Oct 30 '17 at 05:06

1 Answers1

0

You could try #[payload[0]['ConverstaionEnd_dt']], or use a variable #[payload[0][flowVars.fieldName]]

aled
  • 21,330
  • 3
  • 27
  • 34
  • Thanks for the input, I had developed a workaround and code is owned by Support team so I don't have the opportunity to make changes and check. Thanks – SDE May 30 '18 at 06:28