Hoppa till huvudinnehållet

String to Int


8 kommentarer

  • Aaron Wong

    Looks like you're referencing a value from a form element? Is that a Number form element? 

    If so, you can simply add .numeric (i.e. $inspectionForm.state.combustibility.value.numeric) 

    That's how mine works.

  • Brian Bulla

    Thanks Aaron,

    I think that worked….but now another error has come up.  These error messages are very cryptic.  Is there a way to debug code line by line with a workflow??

  • Aaron Wong

    click settings, thne change log level to debug then open log viewer to view the same messages. 

  • Brian Bulla

    Thanks Aaron!

  • Brian Bulla

    Hi Aaron,

    So while I can now run the code with no errors, the values that are in the form are not getting saved in the table.  The ones in question are all that are using the .numeric.  Any ideas of what might be going wrong?

    In my form two of the three attributes get a value typed in, and in the third it is selected from a drop down.

    In the table, the format for the fields are all “DOUBLE”.  The table is in a secured esri webservice.

    The record in the table is saving, and all the text data is saving….it's just these DOUBLE fields that are sitting blank, yet in the form they are all filled in.  I'm using .value.numeric to convert them….maybe i should be trying something else??

  • Brian Bulla

    This is my code on the “Create Feature” object if it helps any.  I've tried both .numeric and .double, but to no avail.  I also notice that niether .numeric nor .double show up in the intellisense.

    All of this works, except for the middle three:  COMBUSTABILITY, OXYGEN and MH_DEPTH

        "INSP_DATE": $inspectionForm.state.inspectDate.value.value,
        "DATEWORK": $inspectionForm.state.txtWorkCompletedDate.value,
        "FACILITYID": $inspectionForm.state.manholeID.value,
        "LOCATIONDESCRIPTION": $inspectionForm.state.locationDescription.value,
        "SETTLEMENTAREA": $inspectionForm.state.settlementArea.value,
        "LOCALMUNICIPALITY": $inspectionForm.state.municipality.value,
        "DEPOTAREA": $inspectionForm.state.depotArea.value,    
        "INSPECTED_BY": $inspectionForm.state.inspectedBy.value,
        "COMMENTS": $inspectionForm.state.comments.value,   
        "COMBUSTABILITY": $inspectionForm.state.combustibility.value.numeric,
        "OXYGEN": $inspectionForm.state.oxygen.value.numeric,
        "TOXICITY": $inspectionForm.state.toxicity.value,
        "CLEANREQ": $inspectionForm.state.cleaningRequired.value,
        "RAISE_MH": $inspectionForm.state.raise.value,
        "LOWER_MH": $inspectionForm.state.lower.value,
        "REPLACE_LID": $inspectionForm.state.replaceLid.value,
        "REPLACE_FRAME": $inspectionForm.state.replaceFrame.value,
        "REPLACE_BRICKS": $inspectionForm.state.replaceBricks.value,
        "RESET_FRAME": $inspectionForm.state.resetFrame.value,
        "STEPS_MH": $inspectionForm.state.steps.value,
        "CHANNEL_OR_BENCHING": $inspectionForm.state.channelOrBenching.value,
        "CRACKED_WALLS": $inspectionForm.state.crackedWalls.value,
        "DETERIORATED_WALLS": $inspectionForm.state.deterioratedWalls.value,
        "INFILTRATION": $inspectionForm.state.infiltration.value,
        "SAFETY_GRATE": $inspectionForm.state.safetyGrate.value,
        "LOCATION": $inspectionForm.state.location.value,
        "PRIORITY": $inspectionForm.state.wrPriority.value   
  • Aaron Wong

    I usually put in a series of Set Feature Attributes rather than jamming it all in the Create Feature. Easier to debug. If you open the Create Feature component within log viewer, expand input and locate attributes, can you see what's being inputted into those 3 fields?

    Back to my question a while ago, are your 3 form elements Number? If not, the .numeric won't show up. For the dropdown one, you can add a * 1 at the end.

  • Brian Bulla

    Hi Aaron,

    To be honest, I kind of overlooked the “Number” suggestion, but I have just updated from a “Text Box” to a “Number”.   I'm more familiar with Windows Form so saw there was a Text Box I could add and just went with that.

    But, that being said it's working now!!  Using “Number” and .value.numeric fixed it.

    Thanks for your help!!


Du måste logga in om du vill lämna en kommentar.