How Necessary is $parent Within a Server Action Repeat?

I have a server action structured like this:

Database Query contact
repeat something
   Set Value this_text = {{this_text.replace('[First Name]', contact.first_name)}}

This is working completely okay, but I believe it technically needs to have a $parent in front of contact.first_name because the Set Value is within a repeat.

Question 1 - Is this correct?

In this case it should read:

Database Query contact
repeat something
   Set Value this_text = {{this_text.replace('[First Name]', $parent.contact.first_name)}}

I am finding that both code examples are working.

Question 2 - Should I add the $parent to my 50 lines of code of this nature to be future proof with Wappler?

This situation came about because I moved the Set Value actions to be within the repeat… and of course Wappler does not change the code within them to include the $parent when I move the actions.

Community Page
Last updated: