Skip to main content
Solved

Add a dynamic value to a table flattening of a REST API


hugo.winkelhorst
Participant
Forum|alt.badge.img+1

Is it possible to add the dynamic values used in a nested call to a table flattening.
In this particular case the first call gets the list of documents and feed the id as a dynamic value to the 2nd call. The response doesn't include any reference to the document and without the id we cannot link the details to a document. I've tried to add it as a static node (name: Document_ID  value {id})
but that only results in errors.
 

 

Best answer by Thomas Lind

Hi ​@pontus.berglund 

Not the path, but the value can be pulled from the source.

I actually have answered this question a few times already. I can’t remember all of them, so I upgraded the guide to show it.

 

View original
Did this topic help you find an answer to your question?

9 replies

Forum|alt.badge.img+2

I have this exact same issue, I’ll link my question here:

@Thomas Lind do you know if this is possible?


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1094 replies
  • Answer
  • June 5, 2025

Hi ​@pontus.berglund 

Not the path, but the value can be pulled from the source.

I actually have answered this question a few times already. I can’t remember all of them, so I upgraded the guide to show it.

 


Christian Hauggaard
Community Manager
Forum|alt.badge.img+5

@hugo.winkelhorst ​@pontus.berglund does Thomas’ answer above resolve your issue? If so please help us by marking the comment as best answer. Please let us know if you have any follow up questions


Forum|alt.badge.img+2

@Christian Hauggaard the solution works in TDI when table builder is available. However in version 20.10.66 we have not been able to get the XSLT code to work since the table builder is not there.

Is there any guide on how to work with XSLT in TX classic?


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1094 replies
  • June 10, 2025

Hi ​@pontus.berglund 

I have a guide for this here.

I explain the structure of XLST as I wrote this guide before the Table Builder was available.

You can use this as a template for those you apply to the field.

 


hugo.winkelhorst
Participant
Forum|alt.badge.img+1

Hi Christian/Thomas,

I'm not getting any closer I've tried adding an additional column in the table flattening I've tried lost of variations and also tried CoPilot and ChatGPT but I'm getting nowhere.

This is the first call that gives me the ID's

And this is the call that's using those Id's as a dynamic value to get the details per ID:

the extra_id is where I'm trying to get the ID used for the call into. This was the last suggestion of CoPilot which returns a null. I've tried ../../../id and ../../../../id and also added the template match from the first call to this one. My best result so far is a completely empty column.


hugo.winkelhorst
Participant
Forum|alt.badge.img+1

I've got it working now, the solution mentioned in the graph API post works for my case as well. I missed it at first and started with the FIXER IO one which doesn't work in my case.


hugo.winkelhorst
Participant
Forum|alt.badge.img+1

It seemed to work but when transforming the data in the prepare instance we notice that it seems it is only getting the first ID into that column. 
My table flattening looks like this, what am I doing wrong?
 

 


Thomas Lind
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 1094 replies
  • June 12, 2025

Hi ​@hugo.winkelhorst 

The root node points at the Id field, its value is . which I assume is the root.

Here is my setup in the full.

 

I used notepad++ and a xml plugin to prettify the code.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes"/>
	<xsl:template match="/">
		<tx_root>
			<xsl:apply-templates select="/TX_Autogenerated_Root/TX_Autogenerated_Element/value" mode="rows"/>
		</tx_root>
	</xsl:template>
	<xsl:template match="/TX_Autogenerated_Root/TX_Autogenerated_Element/value" mode="rows">
		<GroupMembers>
			<xsl:element name="id">
				<xsl:value-of select="id"/>
			</xsl:element>
			<xsl:element name="displayName">
				<xsl:value-of select="displayName"/>
			</xsl:element>
			<xsl:element name="officeLocation">
				<xsl:value-of select="officeLocation"/>
			</xsl:element>
			<xsl:element name="userPrincipalName">
				<xsl:value-of select="userPrincipalName"/>
			</xsl:element>
			<xsl:element name="mail">
				<xsl:value-of select="mail"/>
			</xsl:element>
			<groupid>{id}</groupid>
		</GroupMembers>
	</xsl:template>
</xsl:stylesheet>

My point is. I think it points at the wrong part and therefore has a root node that isn’t of multiple values and then it will not know what to add in the external id field.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings