How to get value from custom query

I have a custom query that is returning an output value. It is returning the correct value but I need to set a value to that. How do i code it?

{
    "queryUserName": {
        "fldUserLastName": "Eis",
        "fldUserFirstName": "Baub"
    },
    "combinedNote": "  Reviewed and electronically signed by Baub Eis on Aug 15, 2024",
    "setNoteStatus": 8,
    "customGetNoteID": [
        {
            "": 205248
        }
    ],
    "VarNoteID": null
}

I'm trying to get the customGetNoteID into the VarNote as a number.

was thinking it might of had a value of customGetNoteID.value, but I think its actually an object and needs to be converted to a number?

Any direction would be awesome!
@patrick

Hey Baub,

How you get that custom query?
I see empty name with a value...
How?
A screenshot of the custom query would help...

(But if I had to guess it would be customGetNoteID[0].$value)

And here is my stored procedure:

 WHERE TableName = @TableName AND FieldName = @FieldName

IF @@ROWCOUNT = 0
 BEGIN
  BEGIN TRY
    -- This expects unique or PK index defined on the dbo.tbl_ID_Sequence table
    INSERT INTO dbo.tbl_ID_Sequence (NextIDValue, TableName, FieldName)
      VALUES (1, @TableName, @FieldName)
    SET @NextID = 1
  END TRY
  BEGIN CATCH
      -- The above INSERT may fail when the row exists already, so use just the UPDATE
      UPDATE dbo.tbl_ID_Sequence SET @NextID = NextIDValue = NextIDValue+1 
     WHERE TableName = @TableName AND FieldName = @FieldName
  END CATCH
 END

END
SELECT @NextID
```
No Schema set on the custom query.  I've tried with and without.  Need to figure out how to assign something to that "".  But I did something simliar to this before with a storedprocedure and there was just a way to code it, @patrick helped me.  I just can't remember where that code was to look at it again.

Hello @baub
You need to run your custom query on the builder popup.
For example:

You can see I'm using a custom query (red)

  1. Give some test value (orange)
  2. Run it (yellow)
  3. Then check the schema and save (green)

After that you can see those values on the picker

You can also assign your own custom schema:

1 Like