Jump to content
Graham Quince

FrogCode widget - Data to Form

Recommended Posts

data_to_form.png

I've been working on this widget for some time and I think it solves a big issue for everyone.  If your experience working in school was anything like mine, at some point, you will have wanted to display personal data back to the logged in user that did not originate from the MIS.

Things like:

  • Login credentials for 3rd Party systems
  • Account balances for cashless catering
  • Appointment times
  • Times of music lessons
  • Short term grades
  • Personal revision links
  • Tutor details
  • Reward points
  • After School clubs
  • Exam timetables (?)

I've come up with widget which allows you to add a spreadsheet into a Form.  You do have to set the form up first (although the widget contains instructions on what you need to do).  Once the information is in, you can use Access Control to set privacy settings.

 

 

You can download the widget from this link:
https://schools.frogeducation.com/community/frogcode/frogcode-showcase/data2form

 

For those of you looking for a way to replicate Frog3 custom fields, this widget should help you achieve that.

  • Like 1
Link to comment
Share on other sites

While the widget will display the information for you, you can use this code to retrieve it for yourself:

<div class="my_data"></div>
<script>
var myDataDiv = arguments[0].find('.my_data');
var user = FrogOS ? FrogOS.getUser() : self.getUser();
var formUUID = 'FORM_UUID';


    Frog.Model.api('dataviewer.gettable', {
        content_uuid: formUUID,
        current_user_only: 'false',
        form_uuid: formUUID,
        limit: 1,
        module: 'form',
        offset: '0',
        sort_dir: 'DESC',
        sort_field: 'date'
    }).done(function(response) {
        var personalData = response.data;
        $.each(personalData, function(index, entry) {
            var data = entry.fields[1].responses[0].response;
            data = JSON.parse(data);
            $.each(data, function(index, datum) {
                if (datum) {
                    myDataDiv.append(
                        index+
                        ' : '+
                        datum
                    )
                }
            }) // end of data $.each
        }); // end of personalData $.each
    }); // end of API response

</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...