How to Retrieve Entity attributes in JavaAction

0
Hello, I have an JavaScript Action which accepts List (entity) as parameter. I am trying to retrieve attribute ID from each entity in a List parameter in a loop. Does anyone know how to loop through each entity and retrieve the ID in JavaScript Action?  
asked
1 answers
2

As per your screenshot, the Parameter_2 is a list of some type(which you dont have selected in your screenshot, but i supposed you will)

this Parameter_2 will be the JSACtion function input parameter which you can simply console.log and check what is this object all about. then using Vanilla Javascript concepts you can look it through.
For e.g.: See my example below.

/**
 * @param {MxObject[]} candidates
 * @returns {Promise.<void>}
 */
export async function JavaScript_action(candidates) {
	// BEGIN USER CODE
	console.log(candidates)
	candidates.forEach(candidate => {
		console.log(candidate._guid) // this can get you the ID
	})
	// END USER CODE
}

 

answered