Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I cant get GetRecordsFromForm to work. Are there any documentation out there ?
Hi Jonas,
Yes you can find the documentation about Umbraco Forms here: https://our.umbraco.org/documentation/Products/UmbracoForms/ and for get data from the forms see here. https://our.umbraco.org/documentation/Products/UmbracoForms/Developer/Working-With-Data/
Hope this helps,
/Dennis
Hi Dennis,
Well the documentation is not up to date. This is what I have so far, and I am trying to get the value from the fields in the form, they ar named:
"Your Name" "Email" "Comment"
@{
string formGuid = Model.Content.GetPropertyValue("messageBoardFormGuid", true).ToString();
}
@{ DynamicRecordList records = Library.GetRecordsFromForm(formGuid); <div> @foreach (DynamicRecord record in records.Items) { <div> @record.Created.ToString("dd MMMM yyy")<br /> </div> } </div> }
What if you do something like this would this give you the value of the fields.
@{ string formGuid = Model.Content.GetPropertyValue("messageBoardFormGuid", true).ToString();}@{ DynamicRecordList records = Library.GetRecordsFromForm(formGuid); <div> @foreach (DynamicRecord record in records.Items) { <div> @record.YourName @record.Email @record.Comment @record.Created.ToString("dd MMMM yyy")<br /> </div> } </div>}
Thanks, that works..
I am using
"Your name" "Email, phone or room number" "Message"
"Message" is no problem picking up.
But the others with space in the name are harder to find..
Perhaps you already has found the solution if not, then when you have a field with spaces you can get the value like this.
@record.GetField("Your Name").Values[0]
Where you need to add the caption of the field in the GetField.
@{ @using Umbraco.Forms.Mvc.DynamicObjects string formGuid = Model.Content.GetPropertyValue("messageBoardFormGuid",true).ToString();}<ul id="comments"> @foreach (dynamic record in Library.GetRecordsFromForm(formGuid)){ <li> @record.Created.ToString("dd MMMM yyy")<br /> @record.GetField("Your Name").Values[0]<br /> @record.Email<br /> @record.GetField("Comment").Values[0]<br /> </li> }</ul>
Absolutely great, thanks alot!
:-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
GetRecordsFromForm Umbraco Forms.
I cant get GetRecordsFromForm to work. Are there any documentation out there ?
Hi Jonas,
Yes you can find the documentation about Umbraco Forms here: https://our.umbraco.org/documentation/Products/UmbracoForms/ and for get data from the forms see here. https://our.umbraco.org/documentation/Products/UmbracoForms/Developer/Working-With-Data/
Hope this helps,
/Dennis
Hi Dennis,
Well the documentation is not up to date. This is what I have so far, and I am trying to get the value from the fields in the form, they ar named:
"Your Name" "Email" "Comment"
@{
}
Hi Jonas,
What if you do something like this would this give you the value of the fields.
Hope this helps,
/Dennis
Thanks, that works..
I am using
"Your name" "Email, phone or room number" "Message"
"Message" is no problem picking up.
But the others with space in the name are harder to find..
Hi Jonas,
Perhaps you already has found the solution if not, then when you have a field with spaces you can get the value like this.
Where you need to add the caption of the field in the GetField.
Hope this helps,
/Dennis
Hi Dennis,
Absolutely great, thanks alot!
:-)
is working on a reply...