bIT_sosswald
Returning Responder

Rule with FormDataValueService and dataset GID to access formfield of dataset

Hello everybody,

Requirement:

I try to do the following: In a link template where a dataset can be linked using FS_DATASET, I want to show the title field of the dataset as link text for DOM-Editors.

2024-04-11_09h20_56.png

Since this is not possible by default my approach is to:

  • Add an additional hidden text field
  • Create a rule which is using the FormDataValueService to access the title field of the dataset
  • Copy the value from the title field of the dataset to the hidden text field in the link template
  • Use the hidden text field as link text

Problem

This approach seems to work in general.

But in the documentation there is only a hardcoded gid access mentioned. See: https://docs.e-spirit.com/odfs/template-develo/rules/connecting-exte/determining-inf/index.html#gid_...

So with the following rule I can access the field from the hardcoded dataset.

	<RULE>
		<SCHEDULE delay="0" id="C" service="FormDataValueService">
			<PARAM name="GID">
				<TEXT>9c86b3e9-7207-4d12-a788-f53f82d37bb8</TEXT>
			</PARAM>
			<PARAM name="TEMPLATE">
				<TEXT>tt_download</TEXT>
			</PARAM>
			<PARAM name="FIELD">
				<TEXT>tt_title</TEXT>
			</PARAM>
			<PARAM name="LANGUAGE">
				<TEXT>DE</TEXT>
			</PARAM>
		</SCHEDULE>
		<DO>
			<PROPERTY name="VALUE" source="lt_foo"/>
		</DO>
	</RULE>

 

Question

How can I access not only a hardcoded dataset but the one which the editor selects in the FS_DATASET input component?

I want to have the title of the dataset to be copied to the text field in my link template.

2024-04-11_09h16_48.png

 

Any help is welcome

 

Sandro

4 Replies
StefanS
Returning Observer

Hi Sandro,

I am not completely sure, if it will work. But instead of TEXT it is possible to use PROPERTY within PARAM. So you might be able to use the property GID for the Dataset-field as dynamic parameter.

Cheers,
Stefan

0 Kudos
hjaeger
Elite Observer

Hi everyone.

Any update on this? We have been trying to dynamically fill the GID on the ValueService without success.

all the best,

Hagen

0 Kudos
hoebbel
Crownpeak employee

Hello everyone,

From the upcoming FirstSpirit version 2024.8, it will be possible to use the values of complex input components (e.g. FS_REFERENCE or FS_DATASET) within a value service.
You can therefore write your own value service that can implement the requirements described here.
However, the FormDataValueService and the MetaDataFormService will not yet be extended accordingly within the next FirstSpirit Version. Although this change is loosely planned, it is not yet on the road map. If you consider an extension of these two value services as relevant, then it would make sense to submit a corresponding change request. (submit idea)

Best regards
Holger