Skip to main content
10-Marble
February 9, 2024
Question

Extracting property from infotable for comparision

  • February 9, 2024
  • 1 reply
  • 2146 views

So basically i have a service which takes some ID (Number) as input and gives the details of that specific ID. The given details of the output parent infotable are:

number
deeplink
relatedIssues
owner
createdDate
daysOpen
targetCloseDate

 

So this "relatedIssues" property is another infotable which has another infotable as a property called "fieldData"

and i want to pick the property "CreatedOn" of the fieldData infotable and compare it with the "createdDate" property of the parent infotable. And parse it to have the difference as an output of the service alongside to display it later. 

 

 

1 reply

Rocko
19-Tanzanite
February 9, 2024

It is quite hard to follow this description, also there is no clear question - what do you want to know?

If you have nested infotables, each of them can have multiple rows, so you will have to iterate through all rows of the nested infotables to make the comparison with the parent table.

10-Marble
February 9, 2024

Yes the thing you have mentioned, iterating through the rows of nested infotables to access a property in the child infotable.

Rocko
19-Tanzanite
February 9, 2024

it would go something like this, but it's still pretty much guesswork

parentInfoTable.rows.toArray().forEach(row=>{
	let relIssues=row.relatedIssues;
	relIssues.rows.toArray().forEach(issuesRow=>{
		let fData=issuesRow.fieldData;
		fData.rows.toArray().forEach(fdataRow=> {
			let difference=row.createdDate-fdataRow.CreatedOn;
			// do something with the difference
		});
	});
});

This does not include the necessary error-checking you would need for robust code and assumes all nested infotables have multiple rows.