Default values in form fields based on page type datas

Monjoie Dominique asked on December 5, 2017 15:54

Hi everyone,

I try to avoid people insert informations more than one time. I have a contribution list to register datas such as Company, Name, Address, Zip Code and City among others. Through these informations, people have a presentation card on the website.

On the other hand, they could ask for promotional material (via a form; informations have to be sent in an Excel sheet to the logistic center).

People can ask for material at any moment in their own page.

May I use something like {%custom_tableXX.Society#%} instead of {%CurrentUser.Entreprise#%} used previously when someone register. Every user has a different UserID.

Thanks.

Correct Answer

Brenden Kehren answered on December 6, 2017 15:10

Yes you can use macros to get data from other objects to set as default values. The key is you need to make sure those other fields are filled out otherwise they will return a null/empty value. For instance if you want to prefill someones first and last name in a form you can use:

CurrentUser.FirstName and CurrentUser.LastName. BUT the registration process of creating an account out of the box, doesn't require a first and last name so those values will be empty. The FullName field is required though.

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.