Hello friends, please, I need to update this record (formationsIds = typeFormation.formationsIds ) but with the following condition: if the (formationsNames) contains the term "Valide."
Announcement
Collapse
No announcement yet.
help with a syntax formula
Collapse
X
-
That would not work string/contains search in a string and formationsNames is an array. If valide is a name of the formation record you can try code below:
PHP Code:if (array\length(formationsIds) > 0) {
$i = 0;
while($i < array\length(formationsIds)) {
$name = record\attribute('Formation', array\at(formationsIds, $i), 'name');
if (string\contains($name, 'Valide')) {
entity\addLinkMultipleId('formations', array\at(formationsIds, $i));
}
$i = $i + 1;
}
}
Rabii
Web Dev
Comment
-
I tried that too.
PHP Code:
if (array\length(classe.formationsIds) > 0) {
$i = 0;
while($i < array\length(classe.formationsIds)) {
$name = record\attribute('Formations', array\at(classe.formationsIds, $i), 'name');
if (string\contains($name, 'Valide')) {
entity\setAttribute('Meeting', $i);
}
$i = $i + 1;
}
}
Comment
-
Originally posted by abidoss View PostHello Rabii, thank you for your help. Indeed, your code found the 3 records, but it didn't manage to find one with the name "valide".PHP Code:$name = record\attribute('Formations', array\at(classe.formationsIds, $i), 'name');
Formations ??? it should be single - name of the entity should be always single.Rabii
Web Dev
Comment
Comment