http://coldfusion.com logo
Join Slack
Powered by
# cfml-beginners
  • e

    epipko

    09/30/2024, 3:32 PM
    Can someone help with resolving this error that I receive while making API call:
    JSON parsing failure at character 1:'<' in <!DOCTYPE html> <html lang="en"> <head> <InvalidTag charset="utf-8"> <title>Error</title> </head> <body> <pre>Internal Server Error</pre> </body> </html>
    Does it mean an issue on the remote site?
    r
    a
    r
    • 4
    • 31
  • d

    dinie

    10/03/2024, 1:58 AM
    How do I make the query so that I can upload multiple files in the database?
    a
    g
    j
    • 4
    • 5
  • j

    Jordan Ross

    10/03/2024, 6:17 PM
    @Jordan Ross has left the channel
  • j

    Jordan Ross

    10/03/2024, 6:17 PM
    @Jordan Ross has left the channel
  • g

    gsr

    10/07/2024, 1:19 PM
    i applied all the new updates to coldfusion and i am still getting this error WDDX packet parse error at line 1, column 3401. Invalid WDDX packet: root element in not wddxPacket. i made the changes to the cfserializefilter.txt to include the form and url scopes
    a
    • 2
    • 10
  • g

    gsr

    10/07/2024, 7:32 PM
    question on somethingi came across, i logged to coldfusion admin 2021 and went to seetings summatry and got this error : Element DEBUGGER.IPLIST.IPLIST is undefined in VARIABLES. Template : /CFIDE/adminapi/debugging.cfc
  • a

    alholden

    10/08/2024, 11:50 PM
    @gsr That seems to me like an incomplete installation or update, or a file has been removed or had a permission change. This param holds the IP Addresses for which debug info should be shown, even if blank. Yours doesn't exist at all? I doubt you could get here without that error, but if you can load "Debugging IP Addresses" from the "Debugging & Logging" menu item of the CF administrator, try clicking on the "Add Current" button and see if that fixes it. You can "Remove" it later if you want. Or do both a few times. Alternately, maybe click the "Submit Changes" button on the "Debug Output Settings" window. That's weird. The install and update processes will produce logs with any problems. Maybe revert your last Update and try applying it again?
  • h

    hugh

    10/18/2024, 8:06 PM
    can anyone provide a link to a resource for working with the dropbox API and cfml?
    g
    • 2
    • 2
  • e

    epipko

    10/21/2024, 6:34 PM
    Can someone point to what I am missing?
    <cfset *File* = "\\Prod\c$\Temp\Kohls.xlsx">
    <cfspreadsheet action="read" *name*="cust" src="#File#" *query*="myQuery" />
    <cfoutput>#cust#</cfoutput>
    Attribute validation error for tag CFSPREADSHEET. It has an invalid attribute combination: action,name,query,src. Possible combinations are: Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,format,headerrow,name,rows,sheet,src'. Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,format,headerrow,name,rows,sheetname,src'. Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,headerrow,query,rows,sheet,src'. Required attributes: 'action'. Optional attributes: 'columnnames,columns,excludeheaderrow,headerrow,query,rows,sheetname,src'. Required attributes: 'action'. Optional attributes: 'columnnames,excludeheaderrow,format,headerrow,name,rows,sheet,src'. Required attributes: 'action'. Optional attributes: 'columnnames,excludeheaderrow,headerrow,query,rows,sheet,src'. Required attributes: 'action'. Optional attributes: 'columnnames,excludeheaderrow,headerrow,query,rows,sheetname,src'.
    p
    e
    • 3
    • 36
  • e

    epipko

    10/29/2024, 10:35 PM
    I am loading .xlsx into a database. One of the cells' value is $100,037. I need to format it to be 100037. If I'd to use NumberFormat(), what mask should I use?
    r
    • 2
    • 8
  • g

    gsr

    11/03/2024, 1:32 PM
    how to build something to automcatically scan google drive and check for folders and if there are new folders and have images inside them sould i use apikey or oauth for it, i am trying to make a scheduled task for it
  • e

    epipko

    12/06/2024, 8:50 PM
    Hi, anyone making calls to GraphQL from CF? I am using CF2018 and lookking into Shopify's guide for CURL:
    curl -X POST \
    <https://your-development-store.myshopify.com/admin/api/2024-10/graphql.json> \
    -H 'Content-*Type*: application/json' \
    -H 'X-Shopify-*Access*-Token: {access_token}' \
    -d '{
    "query": "query { draftOrders(first: 10) { edges { node { id } } } }"
    }'
    I usually convert that into cfhttp call by replacing -H with cfhttpparam type="header" ... But what type of transaction type is -d ? Is it type="body"?
    p
    r
    m
    • 4
    • 11
  • e

    epipko

    12/11/2024, 9:42 PM
    This works:
    Copy code
    <cfset gql = '{"query": "{products(first: 3) {edges {node {id title} }}}"}'>
    I want to be able to save potentially larger query in this format. How do I do that? (Sending it as is will not work)
    Copy code
    <cfset gql = '{
      "query": "{
        products(first: 3) {
          edges {
            node {
              id
              title
            }
          }
        }
      }"
     }'
    >
    e
    s
    +2
    • 5
    • 64
  • e

    epipko

    12/31/2024, 7:57 AM
    I thought, with your help I was able to handle this, but ... I am still having issues with passing a GraphQL query via <cfhttp>. I came up with the query:
    Copy code
    <cfset gql = '{orders(first: 3, query: "id:>=5790166450355", sortKey: CREATED_AT) {edges {node {id name risk {recommendation } updatedAt } } } }'>
     <cfoutput>#gql#<br /><br /></cfoutput>
    This returns:
    {orders(*first*: 3, *query*: "id:>=5790166450355", sortKey: CREATED_AT) {edges {node {id *name* risk {recommendation } updatedAt } } } }
    I copy/past it into GraphiQL app in Shopify and it works just fine. When I pass it into <cfhttp>
    Copy code
    <cfhttp    
      url="<https://unionbay-clothing.myshopify.com/admin/api/2024-10/graphql.json>"         
      method="POST"
      resolveurl="true" 
      timeout="60" 
      result="httpResp">
        <cfhttpparam type="header" name="X-Shopify-Access-Token" value="secret_key" />
        <cfhttpparam type="header" name="Content-Type" value="application/json" />
        <cfhttpparam type="header" name="Accept" value="application/json" />
        <cfhttpparam type="body" value="#gql#">
     </cfhttp>
     <cfdump var="#httpResp#" abort="true">
    it returns:
    {"status":400,"error":"The json provided is not formatted correctly: Error occurred while parsing request parameters"}
    All attempts to work with Shopify support end up with "Works on our end. It must be the way your app sends in a request. Contact Adobe for help." Does anyone know if <cfhttp> actually sends cURL command on the back end?
  • e

    epipko

    12/31/2024, 7:59 AM
    graphiQL.png
    e
    e
    +2
    • 5
    • 57
  • e

    epipko

    01/15/2025, 5:35 PM
    Can anyone tell me how to deal with this error: JSON parsing failure at character 1:'<' in <html> <body> <noscript> .... caused by
    <cfset jsonData = deserializeJSON(httpResp.fileContent) />
    g
    j
    +2
    • 5
    • 30
  • e

    epipko

    01/23/2025, 6:43 PM
    I have to check order risks (determined by Shopify) on every order. Sometimes it's not available and comes back with the following: Status: 200 OK Filecontent: {"risks":[]} When I try to do the following, it fails
    <cfif #risk_httpResp.Filecontent# EQ "{"risks":[]}">
    Risk Analysis is not available
    </cfif>
    Invalid CFML construct found on line 28 at column 58 28 : <cfif #risk_httpResp.Filecontent# EQ "{"risks":[]}"> 29 : Risk Analysis is not available 30 : </cfif> Do I need to escape specific character(s)? If so, how?
    e
    a
    • 3
    • 28
  • j

    johnbarrett

    01/28/2025, 1:39 AM
    Aloha, Does anybody know of an tutorial or a CF meetup that teaches how to work with APIs in ColdFusion? I need to learn about APIs for a possible job. I am confused on why would would want to use a API, I think that they are used if you want to share your application, such as Google Maps. Any help would be gratefully appreciated. Thanks!
    j
    s
    +3
    • 6
    • 15
  • m

    molluskorg

    02/06/2025, 8:43 PM
    Hi. Does anyone have a recommendation for preserving leading zeros when using CFSPREADSHEET to export to .xlsx with CFQUERY being used to get the data for export?
    m
    s
    • 3
    • 7
  • e

    epipko

    02/28/2025, 6:28 PM
    Hi, I need to retrieve data from Shopify that is paginated. I can only get 250 records max at the time. Here is the link in Responseheader: <https://site.com/admin/api/2025-01/gift_cards.json?limit=250&page_info=eyJzdGF0dXMiOiJlbmFibGVkIiwibGFzdF9pZCI6NTA5ODMxNzA4ODUxLCJsYXN0X3ZhbHVlIjoiNTA5ODMxNzA4ODUxIiwiZGlyZWN0aW9uIjoibmV4dCJ9>; rel="next" What would be the easiest/cleanest way to look for "*next*" at the end of the link sting?
    a
    • 2
    • 15
  • d

    David Johnson

    03/03/2025, 4:06 PM
    I'm looking at updating our script-based older version of SVG-Edit. I am attempting to get to the latest stable version. However, the newer releases of SVG-Edit uses ES Modularity with commands like 'import from @svgedit/svgcanvas' and I'm not sure how CF or Lucee incorporates these modules. I've been in web scripting a while but I'm not sure how to incorporate npm or 'building' an ES module. Any tips or best practices to offer?
    a
    p
    • 3
    • 39
  • j

    johnbarrett

    03/11/2025, 5:34 AM
    i am trying to create a login system in ColdFusion, but i am stuck and could really use some help. i am using mostly modified code from the CFWACK book. The application is not working and i can't figure out why not. Am i missing something in the code? i am using an Application.cfc file and the login form, which is just a basic form, and a file to check the form. Below the code can be found. i really appreciate any help that somebody can provide. Thanks so much!
    Copy code
    <!--- Application.cfc --->                                                                                <cfcomponent output="false">
    
      <!--- Turn on session management. --->
      <cfset this.sessionManagement=true>
      <!--- Default datasource --->   
      <cfset this.dataSource="codingtask">     
    
      <cffunction name="onRequestStart" output="false" returnType="void">
      
        <!--- If user isn't logged in, force them to now ---> 
        <cfif not isDefined("session.auth.isLoggedIn")>
          <!--- If the user is now submitting "Login" form, --->
          <!--- Include "Login Check" code to validate user --->
          <cfif isDefined("form.UserLogin")> 
            <cfinclude template="loginCheck.cfm">
          </cfif>
    
          <cfinclude template="loginForm.cfm">
          <cfabort>
        </cfif> 
    
      </cffunction>
      
    </cfcomponent> 
    ----------------------------------------LoginForm.cfm-----------------------------------------------------------------<!--- If the user is now submitting "Login" form, --->
    <!--- Include "Login Check" code to validate user --->
    <cfif isDefined("form.UserLogin")> 
     <cfinclude template="LoginCheck.cfm">
    </cfif>
    
    
    
    <html>
    <head>
     <title>Please Log In</title>
    </head>
    
    <body>
    
    <!--- Start our Login Form --->
    <form action="LoginCheck.cfm" name="LoginForm" method="post">
     <!--- Use an HTML table for simple formatting --->
     <table border="0">
     <tr><th colspan="2" bgcolor="silver">Please Log In</th></tr>
     <tr>
     <th>Username:</th>
     <td>
     
     <!--- Text field for "User Name" ---> 
     <input 
     type="text"
     name="userLogin"
     size="20"
     value=""
     maxlength="100"
     required="Yes">
    
     </td>
     </tr><tr>
     <th>Password:</th>
     <td>
     
     <!--- Text field for Password ---> 
     <input 
     type="password"
     name="userPassword"
     size="12"
     value=""
     maxlength="100"
     required="Yes">
    
     <!--- Submit Button that reads "Enter" ---> 
     <input type="Submit" value="Enter">
     
     </td>
     </tr>
     </table>
     
    </form>
    
    </body>
    </html>
    --------------------------------------------LoginCheck.cfm------------------------------------------------------------<!--- Make sure we have Login name and Password --->
    <cfparam name="form.userLogin" type="string">
    <cfparam name="form.userPassword" type="string">
    
    <!--- Find record with this Username/Password --->
    <!--- If no rows returned, password not valid --->
    <cfquery name="getUser">
     SELECT ContactID, FirstName
     FROM Users
     WHERE UserLogin = 
     <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.UserLogin#">
     AND UserPassword = 
     <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.UserPassword#">
    </cfquery>
    
    <!--- If the username and password are correct --->
    <cfif getUser.recordCount eq 1>
     <!--- Remember user's logged-in status, plus --->
     <!--- ContactID and First Name, in structure --->
     <cfset SESSION.auth = structNew()>
     <cfset SESSION.auth.isLoggedIn = "Yes">
     <cfset SESSION.auth.contactID = getUser.contactID>
     <cfset SESSION.auth.firstName = getUser.firstName>
    
    
     <cflocation url="welcome.cfm">
    </cfif>
    😮 1
    t
    j
    +5
    • 8
    • 15
  • r

    rodyon

    03/13/2025, 11:44 AM
    reading thread above - I would advice any beginner to start with very simple, dumb examples, and build next steps on foundation of previous steps
    👍 1
  • r

    rodyon

    03/13/2025, 11:46 AM
    when reading tutorials I often see how examples presented use spaghetti of different technologies. Example - JWT and OAuth - every example I seen doing it with Javascript - it will be compulsory example building both server and client.
  • r

    rodyon

    03/13/2025, 11:48 AM
    such approach creates mess in student's head, I believe modules and concerns should be strictly separated. Building login module? Start with form and 1 cfquery, plaintext password. Then learn why plaintext passwords are bad. Learn basics of hashing and cryptography, then return and enhance dumb yesterday's example with new knowledge.
  • r

    rodyon

    03/13/2025, 11:48 AM
    just my 🪙🪙 on learning
  • e

    epipko

    03/17/2025, 6:19 PM
    I am making an API call and trying to get the size of the line_items array returned. Trying by doing this, but it errors out with "You have attempted to dereference a scalar variable of type class coldfusion.runtime.Array as a structure with members. " I don't need to loop over the jsonData array as I am making one call per transaction.
    Copy code
    <cfset jsonData = deserializeJSON(httpResp.fileContent) />
     <cfdump var=#jsonData#>
     
     <cfset item_qty = ArrayLen(jsonData.line_items)>
     <cfoutput>#item_qty#</cfoutput>
    e
    • 2
    • 2
  • d

    David Johnson

    03/20/2025, 1:54 PM
    I am incorporating the cfsimplicity Spreadsheet.cfc into my Lucee 6.1.1.118 install. I have placed the Spreadsheet.cfc file and successfully called an init. However, that is the only file that I have transferred and it would appear I have to do something with these (according to the docs) helpers/ objects/ lib-osgi.jar osgiLoader.cfc Spreadsheet.cfc Am I to take the folders out of the downloaded zip and place them in the same folder that Spreadsheet.cfc exists in? As well as the other two files?
    m
    e
    • 3
    • 9
  • d

    David Johnson

    03/20/2025, 1:55 PM
    I'm sure I'm just being thick about this, but I'm not able to derive my next move here from what I've read in the docs.
  • e

    epipko

    03/21/2025, 4:31 PM
    Really silly question, but is it possible to schedule a task BIWEEKLY in CF UI?
    e
    d
    s
    • 4
    • 11
1...45678Latest