Jump to content


Caspio Ninja
  • Posts

  • Joined

  • Last visited

Everything posted by NikkiC

  1. Hi there, I have a tabular report with inline edit and delete enabled. This report shows a list of comments made by different users. I wish to only show the edit / delete options for the user who has made the comment. I have tried this: <script> var user = "[@authfield:User_info_User_ID]"; var author = "[@field:Card_comments_and_updates_Author_ID]"; if (user === author) { document.getElementByClassName("cbResultSetActionCell").style.display = "block"; } if (user !== author) { document.getElementByClassName("cbResultSetActionCell").style.display = "none"; } </script> but it's not working. I think it's something to do with the fact I've used "getElementByClassName", but there is no ID assigned to this field, so not sure how to reference it. I've added an html field to write YEP if the user=author and NOPE if not, just to check this is working OK, which it is in the attached screenshot, so I just want to apply this same logic to show or hide the edit / delete (which is inside this row: <td class="cbResultSetActionCell cbResultSetData"> The only other way I can think of to do this is to completely hide the edit / delete section, and then add a new one in, in the html field where I've currently got the YEP/NOPE. But I don't know what custom link needs to go in there for edit and delete, or if this can even be done in the same way you can add a custom save / delete button in a datapage. Any help would be much appreciated! Many thanks Nikki
  2. Hi there, I have a details report datapage, where users can update information in this page. I'd like to somehow determine what has been updated every time this page is accessed, without having to list all of the fields. Caspio support suggested I do this using triggered actions, but I can't see how this is doable as there's no way to check if an element has changed, and it would mean specifying each individual field. I feel like this should be doable in JavaScript, but can't quite figure out how. My datapage reads from the table Card, but auto updates a separate table called Card_comments_and_updates, so I'd like the script to add a comma separated string to pass as a parameter listing all the field names that have changed, to this second table. Can anyone help me with this, please? TIA! Nikki
  3. This works perfectly, thank you so much @MayMusic! This issue has been with Caspio support for a week and they haven't been able to help
  4. Hi there, I have a tabular report datapage, that I am using to display calculations from my table. I want to show week number, and what has happened during that week. So far I have 2 columns other than week number, number of cards updated, and total number of updates. The calculations I am using are working fine, but it's showing each number as a separate row. So if the calculation for week 6 is 7 updates, it shows 7 rows. See attached screenshot. Below is my code. Anyone know how I only show each line once (so there's only 1 row for each week number) Number of cards updated SELECT COUNT (DISTINCT [@field:Card_ID]) FROM Card_comments_and_updates WHERE Week=target.[@field:Week] Total number of updates SELECT COUNT([@field:Card_ID]) FROM Card_comments_and_updates WHERE Week=target.[@field:Week]
  5. Hi there, I have a formula that is working fine in most instances, but it falls down every once in a while. I think I've got it figured out and then it falls down again! This is my code IsNull((SELECT sum(IsNull([@field:Optimiser_RatingX],0)+IsNull([@field:QA_Tester_RatingX],0)) FROM Card_comments_and_updates WHERE User_ID=[@field:Analyst_IDX])/((SELECT COUNT(IsNull([@field:Optimiser_RatingX],0)) FROM Card_comments_and_updates WHERE IsNull([@field:Optimiser_RatingX],0) >0 AND User_ID=[@field:Analyst_IDX])+(SELECT COUNT(IsNull([@field:QA_Tester_RatingX],0)) FROM Card_comments_and_updates WHERE IsNull([@field:QA_Tester_RatingX],0) >0 AND User_ID=[@field:Analyst_IDX])),0) I want it to display zero if it can't calculate anything! Basically my datapage displays all my users along with an average of all the star ratings they have. The calculated field looks in a different table for every instance where the user ID in this table is listed in the Analyst column. Then it checks the 2 different fields where ratings are given (QA Tester Rating and Optimiser rating) for values more than 0. Adds them together and then divides them by the count, thereby giving the average. For the most part it works fine ... EXCEPT where there are fields where either the QA Tester Rating or Optimiser Rating are zero. Help! Many thanks Nikki
  6. Hi there, I have records called Cards, which span 5 different stages. If the first part of the Card is completed, the user is in stage 1. If the first and second part is completed, they are in stage 2 etc etc. I'd like to automate this (currently they can choose their own stage via a dropdown), and have written the following script, but it's not working. <script> var count_Brief= ("[@field:Brief]").length; var count_AnalystNotes = ("[@field:Analyst_Notes]").length; var count_RecTest = ("[@field:Recommended_test]").length; var count_Result= ("[@field:Actual_result]").length; if (count_Brief > 1) { document.getElementById("EditRecordStage").innerHTML = "2. Brief"; } else if (count_Brief > 1 && count_AnalystNotes > 1) { document.getElementById("EditRecordStage").value = "3. Analysis"; } else if (count_Brief > 1 && count_AnalystNotes > 1 && count_RecTest > 1) { document.getElementById("EditRecordStage").value = "4. Test"; } else if (count_Brief > 1 && count_AnalystNotes > 1 && count_RecTest > 1 && count_Result > 1) { document.getElementById("EditRecordStage").value = "5. Result"; } else { document.getElementById("EditRecordStage").value = "1. Question"; } </script> Does anyone have any insight here? Many thanks Nikki
  7. Hi, I have a Submission form datapage and the submit button isn't working. it's quite specifically styled, so I have added a header and footer to this page in order to contain the style, as it didn't seem to work doing it by the associated style sheet (I need a background image to span the whole table and then separate background images for individual cells). When the header and footer is enabled, the submit button doesn't work. When I delete the header and footer, the submit button does work, but my layout doesn't. I've tried adding the button as a separate element in an html field, and again it doesn't work. Does anyone know why this is happening and what I can do to sort it out? Many thanks Nikki
  8. Just to let anyone know if they're interested that I got this script to work, by changing the datapage! There must have been something in the original one that stopped it from working.
  9. I've been working on this, and managed to find a solution which works in a testing environment, but not within Caspio! <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-cardid="[@field:Card_ID#]">[@field:Question]</button> <div class="modal fade" id="exampleModal" role="dialog" aria-labelledby="exampleModalLabel"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="exampleModalLabel">Card ID</h4> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> <script> $('#exampleModal').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var recipient = button.data('cardid') var modal = $(this) modal.find('.modal-title').text('Card ID ' + recipient) modal.find('.modal-body').html('<iframe src="https://account.testboard.com/TEST_CARD_MODAL.php?Card_ID=' + recipient + '" style="width: 850px; height: 600px;">') }) $('#exampleModal').on('hidden.bs.modal', function () { window.location.reload(); }) </script> Can anybody help??!! Many thanks Nikki
  10. Hi, We have a datapage of a list of current records. At present, we click on a link, and the individual record opens up in a new tab / window. What we would like to do, is have the record appear in a lightbox / modal. However because there is no active "link" involved in opening up a modal (done with Bootstrap - it's simply: data-toggle="modal" data-target="#myModal") and then I would put the Caspio deploy code within div class="modal-content" - how would I ensure the correct record opens up? Many thanks Nikki
  11. Thanks so much for looking at this, @MayMusic, really appreciate it! Yes, it's definitely a head scratcher, but it seems like it should be such a simple thing, my clients are like "why haven't you done this yet"?!!
  12. Hi there, Just re-opened this with Caspio support and thought I'd see if anyone here has any ideas yet? This is a real pain, since the groups themselves don't have a Unique ID I can call (they're all called "Group 1") Any help would be much appreciated! Nikki
  13. Hi there, I am using the standard autosubmit script to send users to one form using parameters to auto fill it and autosubmit it and then on to another form. However some users get stuck in a loop if a field in the first autosubmit form are already in the table, and they never get to the second form and don't see the error message. Is there a way to write into this script "if field already exists in table [users] DO NOT autosubmit, instead show an error message? <script type="text/javascript"> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.forms["caspioform"].submit()',1000); } </script> Many thanks Nikki
  14. Hi, I am using a script in an html block to detect certain criteria and display something based on that criteria. Here is my script: <script> var status = "[@field:Account_status]"; function invitepopup() { window.open("https://c3fot467.caspio.com/dp.asp?AppKey=34fe4000f38aceb2a5da4c74bea2&UserID=[@field:User_ID]", "Invite", "menubar=1,resizable=1,width=500,height=500"); } if (status === "Yes") { document.write("Active"); } else { document.write('<a href="#" onclick="invitepopup()" title="Click to invite again">Invited by [@field:OriginUserName]</a>'); } </script> The if/else works fine, it shows "Active" for all the active users and "Click to invite again" for all the invitees ... however the link doesn't send the parameter properly. https://c3fot467.caspio.com/dp.asp?AppKey=34fe4000f38aceb2a5da4c74bea2&UserID=[@field:User_ID] is passed with the wrong User_ID. It seems to be passing the ID of the last user in the table, rather than the ID of the row it is in - it's currently showing 3 invitees in my table and they all are being received by the popup with the same ID (last user in the table). However if I just put this in as a plain (<a href="https://c3fot467.caspio.com/dp.asp?AppKey=34fe4000f38aceb2a5da4c74bea2&UserID=[@field:User_ID]" title="Click to invite again">Invited by [@field:OriginUserName]</a>), it works completely fine! Is there something in the script which is removing or replacing the User ID? I'm completely stumped! Hope someone can help! Many thanks Nikki
  15. Hi there, Thanks for this, I didn't explain properly ... these aren't separate groups, it's one field, grouped by what's in the field! So my field is "status" and it is grouped by one of 3 items in this field: open, pending, archive. I would like "open" to be expanded, but pending and archive to be collapsed. Many thanks! Nikki
  16. Hi there, I have a tabular report datapage which uses a collapsible group. It seems you can either have all expanded by default or all collapsed by default and nothing in between. Is there a workaround to this, so that I can choose to only have one of my 3 groups open and the other 2 closed? Many thanks Nikki
  17. Thank you so much @nightowl! I've been going round and round in circles on this for a couple of weeks, and definitely need some help! Fingers crossed
  18. Hi @nightowl, I am facing a similar issue, but slightly different and I can't quite seem to tailor your solution to fit. I was wondering if you could give me some pointers? OK, so I have a Submission form datapage, the datasource is my table [DataSources]. I have 2 fields that need to be updated, [Datasource] and [Project]. I'd like to potentially create up to 30 new records, each with a value in the [Datasource] column and the [Project] column. I want to be able to select items graphically, so I have a table of 30 logos, and when I click on any of these, I want them to be "selected". The Project name will always be the same, but there could be up to 30 Datasources if they select all the logos. At present, I have used an html block to display all of my logos and javascript to pass them all to the relevant field. I'll show you the first 5: <a href="#" onClick="SelAdobe()"><img src="http://account.testboard.com/images/logos/Logo-Adobe.gif" id="Adobe" class="MAIN"></a> <a href="#" onClick="SelBARB()"><img src="http://account.testboard.com/images/logos/Logo-BARB.gif" id="BARB" class="MAIN"></a> <a href="#" onClick="SelBBCweather()"><img src="http://account.testboard.com/images/logos/Logo-BBCweather.gif" id="BBCweather" class="MAIN"></a> <a href="#" onClick="SelBloomberg()"><img src="http://account.testboard.com/images/logos/Logo-Bloomberg.gif" id="Bloomberg" class="MAIN"></a> <a href="#" onClick="SelBrandwatch()"><img src="http://account.testboard.com/images/logos/Logo-Brandwatch.gif" id="Brandwatch" class="MAIN"></a> <script> function SelAdobe() { document.getElementById("Adobe").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Adobe,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelBARB() { document.getElementById("BARB").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "BARB,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelBBCweather() { document.getElementById("BBCweather").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "BBC Weather,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; } function SelBloomberg() { document.getElementById("Bloomberg").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Bloomberg,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; } function SelBrandwatch() { document.getElementById("Brandwatch").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Brandwatch,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; } </script> This is all working, in that it updates my table with the selections ... but all on one line. So if we clicked on all the above, it would insert only 1 record like this: Project column: Project1,Project1,Project1,Project1,Project1, Datasource column: Adobe,BARB,BBC Weather,Bloomberg,Brandwatch, Whereas I'd want it to insert 5 separate records. Is this something you can help me with? Many thanks! Nikki
  19. Hi there, I've built a page that has a grid of images, allowing users to click on these images to make a selection ... and then I want these selections to all be saved to a table as separate entries along with their user information. So far, I can get only 1 selection to pass to the table. If they click on one of the images, that is sent to the table, fine. I've set it up so that each selection is added to the string, separated by a comma, but then this passes to the table as a single entry with the comma separated string. This is my code: function SelDatasource1() { document.getElementById("Datasource1").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Datasource1,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } function SelDatasource2() { document.getElementById("Datasource2").className = "SELECTED"; document.getElementById("InsertRecordDatasource").value += "Datasource2,"; document.getElementById("InsertRecordProject").value += "[@authfield:User_info_Project],"; document.getElementById("InsertRecordDatasource").multiple = true; } ...etc etc ... there are over 30 of these. If somebody selects Datasource1, Datasource5, Datasource12, it shows up in the table like this: PROJECT DATASOURCE Project1,Project1,Project1 Datasource1,Datasource5,Datasource12 I am using a Submission form datapage at present, and have added my code using html blocks and footer. 2 things I need help on: 1. I know there is a better way to add a comma to the string, other than putting it in like this (i.e. value +="Datasource1,"). This way, a comma is added for a single entry and at the end of a long string, which I don't want to do - can anybody help me with this? 2. Can I pass this comma separated string so that it shows up in my table like this: PROJECT DATASOURCE Project1 Datasource1 Project1 Datasource5 Project1 Datasource12 Any help would be greatly appreciated! Many thanks Nikki
  20. Hi, I'm stuck on an issue and I'm hoping somebody will be able to help! What I have so far: a table named "Datasources" with a single line for each entry with 2 fields - project and datasource Each Project can have multiple datasources, so some projects may have 20 entries or some may have only 2 or 3, so the table looks like this: PROJECT DATASOURCE [ProjectA] [Datasource1] [ProjectA] [Datasource2] [ProjectA] [Datasource3] [ProjectB] [Datasource1] [ProjectB] [Datasource5] [ProjectB] [Datasource8] etc etc What I need to do: I would then like to set up a datapage, which is like a shop of sorts. It will display 20 different images relating to a library of items available for selection. These would be Datasources 1-20. I would like this page to display all of these logos, but show visually somehow if they have already been selected by that particular project in the Datasources table. So in the example above, when somebody from ProjectB views the table, they will see all 20 datasources, but only Datasource 1, 5 and 8 will be ticked. They then need to be able to select new ones should they wish. So they can click on the logos for Datasource 6, 9 and 10, and when they click the update button those 3 new entries will be passed to the Datasources table. When they refresh the page, Datasources 1,5,6,8,9,10 are all ticked. The issues I have are: How can I get the datapage to search every item in the table and show a different image (i.e. one with a tick overlayed) if that particular project has already selected that datasource? i.e. search table, IF project = ProjectA and Datasource = Datasource2 anywhere in the table, display image "datasource2-ticked". I don't want it to just search one line of the table, but the whole table. How can I get the page of logos to update multiple lines in the same table? i.e. Datasource1 image = "datasource1-grey" UNLESS it has already been selected, in which case image = "datasource1-ticked". Onclick image becomes "datasource1-colour" AND a new record is created with @Project in project column and Datasource1 in @Datasource column. And at the same time this can be done if multiple logos are selected, a new record is created for each one. Help! Many thanks Nikki
  21. Thanks for your reply! However this doesn't work. It's creating a text area and hiding the text field, which is fine, but my original dropdown isn't displaying, so the text area is empty. Any ideas? To clarify: My Datapage reads from the table "Cards" My dropdown is Virtual15 and reads from table "DataSources" (parent field in js) My cascading text field is Virtual16 and uses Virtual15 as parent field (virtual field in js) The text area I've created as part of the instructions is Virtual17 (text area in js) Hope you can help! Many thanks Nikki
  22. Hi there, Ideally I want to use a cascading text area, but apparently only a text field is available as a cascading element. I am using a virtual field and dropdown from lookup table to find the field I want in a table, and then I want to display a full text area from that table on my page (and possibly an image from that table too). Is this doable using javascript? I don't know how to access the correct table as my datapage is obviously linked to the wrong table. Many thanks Nikki
  23. OK, now got this after a bit more research, but still not working!!! Pleeease, anyone?? <script> var dropdown = document.getElementById("EditRecordExpected_Outcome"); var selectedValue = dropdown.options[dropdown.selectedIndex].text; if (selectedValue === "Business Insight") { document.getElementById("result").style.backgroundColor = "black"; } </script>
  24. I'm trying this but no good: <select id="EditRecordExpected_Outcome"> <option value="1">1</option> <option value="Business Insight">Business Insight</option> <option value="3">3</option> <option value="4">4</option> </select> <script> var dropdown = document.getElementById("EditRecordExpected_Outcome"); if (dropdown.value === "Business Insight") { document.getElementById("result").style.backgroundColor = "black"; } </script> <li><a data-toggle="tab" href="#menu4" id="result" style="background-color: #10368F; color: white;">5. TEST RESULT</a></li>
  • Create New...