Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew 142 posts 98 karma points
    Mar 19, 2010 @ 11:08
    Andrew
    0

    writing data to another table

    Hi all

    We have a feedback form which we would like to include a dropdown with a rating (1 - 5) to rate an establishment and then write the result to an table in the umbraco database (the star-rating table to be precise). It will therefore write the record to the main table, but also write this value to this other table. I have looked at datasources and tried to create a form based upon this table, but then cannot see a way to embed one form into another form. 

    I am happy to do this by code if need be, i just dont have any idea how I would go about it -or if its possible at all?

    The net result is that the client wants the starrating to only reflect values captured through the feedback form

    Any help appreciated

    Regards

    Andrew

  • Comment author was deleted

    Mar 19, 2010 @ 11:19

    Hi Andrew,

    I think you'll best look at a workflow instead of datasource, with the workflow you can simply do the insert when the record has been submitted.

    More info on custom workflows in our developer docs: http://umbraco.org/products/umbraco-contour/help-and-support/

  • Andrew 142 posts 98 karma points
    Mar 19, 2010 @ 11:38
    Andrew
    0

    Thanks Tim  - I am going to investigate this right now - will report back on what I find

  • Andrew 142 posts 98 karma points
    Mar 19, 2010 @ 13:52
    Andrew
    0

    Ok, after investigation, I think this will be able to help our cause. Just a couple of questions if I may:

    1. We have created a webservice to accept some values. Is this the best way to go about it, or should we simply "post as xml" to a url, which is a page that reads this xml and does something with it.

    2. are we able to pass through page variables - i.e Data[alias='Pagetitle']

    3. Are there any examples  - other than whats in the documentation?

    Thanks

    Andrew

  • Andrew 142 posts 98 karma points
    Mar 19, 2010 @ 14:13
    Andrew
    0

    Tim 

    i see i need to do a custom workflow....let me try that

    Andrew

  • Comment author was deleted

    Mar 19, 2010 @ 14:57

    Hi Andrew,

    It depends a bit what exactly you are trying to accomplish if you have a form with several fields and 1 is a rating you wish to save addtionally to a table then a custom workflow makes sense.

  • Andrew 142 posts 98 karma points
    Mar 19, 2010 @ 15:05
    Andrew
    0

    yep - thats what i figured -  thanks tim - I will revert back here if have any more queries - in the meantime, i will mark your original answer as soved

  • Andrew 142 posts 98 karma points
    Mar 23, 2010 @ 11:52
    Andrew
    0

    Hi Tim, or anyone else :)

    Quick Question. We have implemented a custom workflow, and are able to read the data, but are having a problem with our dropdown. I have read from a previous post that if you use the a dropdown and add items directly through the form designer, you get a guid, which i have confirmed. We then created a datatype fro our dropdown and used a prevalue source in our form. However, when reading the data, it returns the prevalue id as opposed to the "text" value for the datatype. How do we get the "text" value and not the id?

    Hope that makes sense?

    Andrew

  • Per Ploug Hansen 208 posts 129 karma points
    Mar 23, 2010 @ 12:22
    Per Ploug Hansen
    0

    Hi Andrew

    When working with the data internally, Contour always uses the id's of the different items. So we've added a more efficient layer to read record data, which is the RecordsViewer, this only works with submitted and approved data, but is also the most likely place you need to read out record data.

    using Umbraco.Forms.Data.Storage;

    RecordsViewer rv = new RecordsViewer();
    List<Record> records = rv.GetRecords(form);
    Record r = records[0];

     

  • Andrew 142 posts 98 karma points
    Mar 25, 2010 @ 11:49
    Andrew
    0

    all sorted - thanks al

Please Sign in or register to post replies

Write your reply to:

Draft