kendraio / kendraio-app

Kendraio App
https://app.kendra.io
MIT License
22 stars 6 forks source link

CSV Import interaction with Forms in the workflow builder #27

Closed BBGuy closed 5 years ago

BBGuy commented 5 years ago

Description

This is not so much a bug as a use case. The workflow builder is proving to be incredibly powerful and can be used and task types can be used in lots of creative ways. In the example below I am using a form to generate a CSV export file for a recording. In order to allow me to keep working on the data (it will have more than 3 fields once finished) I have added a CSV import at the top of the workflow to allow me to import the CSV file that I have exported and that works great. However, I have one issue. The form will not start tracking changes until you upload a CSV file. As a result, it will not export a CSV until a CSV is imported. A second small issue is that after importing a CSV file the workflow will not export until you make a change to the form data.

CSV_import_issue

Steps to Reproduce

This is the workflow script I used:

{"title":"PPL Export Example","blocks":[{"type":"csv-import","header":true,"skipEmptyLines":true},{"type":"debug"},{"type":"mapping","mapping":"data[0]"},{"type":"form","hasSubmit":false,"jsonSchema":{"title":"Recording","description":"Register a recording with PPL.","type":"object","required":["isrc","bandArtist","recordingTitle"],"properties":{"isrc":{"type":"string","title":"ISRC","minLength":12,"maxLength":12,"default":""},"bandArtist":{"type":"string","title":"Band/Artist name"},"recordingTitle":{"type":"string","title":"Recording Title"}}},"uiSchema":{}},{"type":"debug"},{"type":"mapping","mapping":"[data]"},{"type":"debug"},{"type":"csv-export","header":true,"skipEmptyLines":true}]}
  1. Paste script into the "Workflow Builder" in https://dev.app.kendra.io/workflow-builder
  2. Enter details
  3. Debug shows no details and "CSV export" button does not work.
darrenmothersele commented 5 years ago

This should be working now that I've changed how the form passes on values.

darrenmothersele commented 5 years ago

@BBGuy can you confirm if this is still an issue?

BBGuy commented 5 years ago

Yes, this works as it should now. vary useful feature to have.

BBGuy commented 5 years ago

Hi, still running into issues with this. on the simple example above it works as it should. however, on a more complex form, the loading of the CSV does not change the form data. If it was empty - form remains empty If it has data - the existing data is unchanged. Below is the form I used.

{"title":"PPL Export Example","blocks":[{"type":"csv-import","header":true,"skipEmptyLines":true},{"type":"debug"},{"type":"mapping","mapping":"data[0]"},{"type":"form","hasSubmit":false,"jsonSchema":{"title":"PPL recording","description":"Register a recording with PPL.","type":"object","required":["ISRC","Band / Artist Name","Recording Title"],"properties":{"ISRC":{"type":"string","title":"ISRC","minLength":12,"maxLength":12,"default":""},"Band / Artist Name":{"type":"string","default":"","title":"Band/Artist name"},"Recording Title":{"type":"string","default":"","title":"Recording Title"},"Version Type":{"type":"string","title":"Version Type","default":"","enum":["Album","Alternative","Demo","Edit","Instrumental","Karaoke","Live","Remix","Session","Single","None"]},"Is Remastered":{"type":"string","title":"Remastered","description":"This recording is remastered","default":"","enum":["Y","N"]},"Genre":{"type":"string","title":"Genre","default":"","enum":["Adult contemporary","Alternative Rock","Bhangra","Blues","Chamber music","Children's music","Christian","Classical","Country","Dance","Easy listening","Erotic","Folk","Gospel","Hip Hop","Jazz","Latin","Middle of the road","Musical (theatre)","New Age","Opera","Operetta","Other","Pop","Rap","Reggae","Religious","Rhythm and Blues","Rock","Rock and Roll","Show","Soul","Sound effects","Spoken word","Unclassified","World music"]},"Content Type":{"type":"string","default":"","title":"Content Type","enum":["Audio","video"]},"(P)Date (YYYY)":{"type":"integer","title":"(P)Date ","default":"","description":"This is usually the year in which copies were first issued to the public. If this took place more than 50 years after the recording was made, or if you are unsure, please contact us to clarify.","minLength":4,"maxLength":4},"(P)Name":{"type":"string","default":"","title":"(P)Name ","description":"The name of the original copyright owner of the sound recording as of the (P)Date."},"Primary Country of Recording":{"type":"string","default":"","title":"Primary Country of Recording"},"Country of Commissioning":{"type":"string","default":"","title":"Country of Commissioning"},"Alternative Title":{"type":"string","default":"","title":"Alternative Title"},"Duration (mm:ss)":{"title":"Duration MM:SS","default":"","type":"string","minimum":3,"maximum":6},"Explicit":{"type":"string","title":"Contains Explicit Lyrics","default":"","description":"This is an indicator that the recording contains explicit lyrical content.","enum":["Y","N"]},"Recording Date (DD/MM/YYYY)":{"title":"Recording Date","default":"","type":"string"},"Language":{"type":"string","title":"Language","default":"","enum":["English","Arabic","Bengali","..needs finishing.."]},"Country of First Publication":{"type":"string","title":"Country of First Publication","default":""},"Recording Venue":{"type":"string","default":"","title":"Recording Venue "},"Local Recording ID":{"type":"string","title":"Local Recording ID","default":"","description":"Local Recording ID"},"This Recording Uses a Sample":{"type":"string","title":"This Recording Uses a Sample","default":"","description":"This recording contains a Sample","enum":["Y","N"]},"This Recording Is a Medley":{"type":"string","title":"This Recording Is a Medley","default":"","description":"The recording is a Medley of more than one individual musical or lyrical works","enum":["Y","N"]},"My Line-up Default":{"type":"string","default":"","title":"Publisher Name"},"Number of Featured Performers":{"title":"Number of Featured Performers","description":"The number of unique Contracted and Other Featured performers who have contributed to the recording. Please refer to the PPL Repertoire Style Guide for further information.","default":"","type":"integer","minimum":0,"maximum":100},"Number of Non-Featured Performers":{"title":"Number of Non Featured Performers","description":"The number of unique Non-Featured performers who have contributed to the recording. Please refer to the PPL Repertoire Style Guide for further information.","type":"integer","default":"","minimum":0,"maximum":100},"I Own The Rights to This Recording":{"type":"string","title":"I Own The Rights to This Recording","default":"","enum":["Y","N"]},"Rightsholder ID 1":{"title":"Rightsholder ID 1","default":"","type":"integer"},"Rights Ownership Type 1":{"type":"string","default":"","title":"Rights Ownership Type 1","enum":["Exclusive Licensee","Original Copyright Owner","Successor In Title "]},"Rights Country Default 1":{"type":"string","default":"","title":"Rights Country Default 1"},"Rights Begin Date 1":{"type":"string","default":"","format":"date","title":"Rights Begin Date 1 (DD/MM/YYYY)"},"Rights End Date 1":{"type":"string","default":"","format":"date","title":"Rights End Date 1 (DD/MM/YYYY)"},"Rights % 1":{"title":"Rights % 1","type":"integer","default":"","minimum":0,"maximum":100},"Rightsholder ID 2":{"title":"Rightsholder ID 2","default":"","type":"integer"},"Rights Ownership Type 2":{"type":"string","default":"","title":"Rights Ownership Type 2","enum":["Exclusive Licensee","Original Copyright Owner","Successor In Title "]},"Rights Country Default 2":{"type":"string","default":"","title":"Rights Country Default 2"},"Rights Begin Date 2":{"type":"string","default":"","format":"date","title":"Rights Begin Date 2 (DD/MM/YYYY)"},"Rights End Date 2":{"type":"string","default":"","format":"date","title":"Rights End Date 2 (DD/MM/YYYY)"},"Rights % 2":{"title":"Rights % 2","default":"","type":"integer","minimum":0,"maximum":100},"Rightsholder ID 3":{"title":"Rightsholder ID 3","default":"","type":"integer"},"Rights Ownership Type 3":{"type":"string","title":"Rights Ownership Type 3","default":"","enum":["Exclusive Licensee","Original Copyright Owner","Successor In Title "]},"Rights Country Default 3":{"type":"string","default":"","title":"Rights Country Default 3"},"Rights Begin Date 3":{"type":"string","format":"date","default":"","title":"Rights Begin Date 3 (DD/MM/YYYY)"},"Rights End Date 3":{"type":"string","format":"date","default":"","title":"Rights End Date 3 (DD/MM/YYYY)"},"Rights % 3":{"title":"Rights % 3","type":"integer","minimum":0,"default":"","maximum":100},"Rightsholder ID 4":{"title":"Rightsholder ID 4","default":"","type":"integer"},"Rights Ownership Type 4":{"type":"string","default":"","title":"Rights Ownership Type 4","enum":["Exclusive Licensee","Original Copyright Owner","Successor In Title "]},"Rights Country Default 4":{"type":"string","default":"","title":"Rights Country Default 4"},"Rights Begin Date 4":{"type":"string","default":"","format":"date","title":"Rights Begin Date 4 (DD/MM/YYYY)"},"Rights End Date 4":{"type":"string","default":"","format":"date","title":"Rights End Date 4 (DD/MM/YYYY)"},"Rights % 4":{"title":"Rights % 4","default":"","type":"integer","minimum":0,"maximum":100},"Rightsholder ID 5":{"title":"Rightsholder ID 5","default":"","type":"integer"},"Rights Ownership Type 5":{"type":"string","title":"Rights Ownership Type 5","default":"","enum":["Exclusive Licensee","Original Copyright Owner","Successor In Title "]},"Rights Country Default 5":{"type":"string","default":"","title":"Rights Country Default 5"},"Rights Begin Date 5":{"type":"string","format":"date","default":"","title":"Rights Begin Date 5 (DD/MM/YYYY)"},"Rights End Date 5":{"type":"string","format":"date","default":"","title":"Rights End Date 5 (DD/MM/YYYY)"},"Rights % 5":{"title":"Rights % 5","type":"integer","default":"","minimum":0,"maximum":100},"Rightsholder ID 6":{"title":"Rightsholder ID 6","default":"","type":"integer"},"Rights Ownership Type 6":{"type":"string","default":"","title":"Rights Ownership Type 6","enum":["Exclusive Licensee","Original Copyright Owner","Successor In Title "]},"Rights Country Default 6":{"type":"string","default":"","title":"Rights Country Default 6"},"Rights Begin Date 6":{"type":"string","format":"date","default":"","title":"Rights Begin Date 6 (DD/MM/YYYY)"},"Rights End Date 6":{"type":"string","format":"date","default":"","title":"Rights End Date 6 (DD/MM/YYYY)"},"Rights % 6":{"title":"Rights % 6","type":"integer","minimum":0,"default":"","maximum":100}}},"uiSchema":{"Primary Country of Recording":{"ui:widget":"k-select","ui:labelProp":"name","ui:valueProp":"alpha2Code","ui:isMultiSelect":false,"ui:ref":"testCountries","ui:refType":"http"},"Country of Commissioning":{"ui:widget":"k-select","ui:labelProp":"name","ui:valueProp":"alpha2Code","ui:isMultiSelect":false,"ui:ref":"testCountries","ui:refType":"http"},"Country of First Publication":{"ui:widget":"k-select","ui:labelProp":"name","ui:valueProp":"alpha2Code","ui:isMultiSelect":false,"ui:ref":"testCountries","ui:refType":"http"}}},{"type":"debug"},{"type":"mapping","mapping":"[data]"},{"type":"debug"},{"type":"csv-export","header":true,"skipEmptyLines":true}]}
BBGuy commented 5 years ago

This must have been a temporary issue as it is working correctly now.