Application Studio. Rest Baq Service. Create New BAQ Record using Rest

Hello EpiUsers!

I am building a Create New Record page in application studio. I want to use the rest Baq Service to create a new record in the uBAQ. The event is below:

Basically, the user goes to a Create Page and fills out some fields on a form.

The fields get automatically added to a temporary DataView whose purpose is to hold a single row, the row to be saved to the database. The DataView is created using the same BAQ as the landing page with the grid and form. The temp DataView is never populated with data until the user clicks away after entering a field.

For example, the user enters the Serial # as test-serial-11, then clicks empty page space, then test-serial-11 is automatically saved to the DataView.

***** The DataView appears to be dirty?**

After the user fills out some fields, the user hits a Save Button. Upon click, the event below is triggered.

I want to load the single row from the temporary DataView into the kinetic-baq, and save it to the database. The rest call parameters are below.

BAQ Options

BAQ Options >> BAQ Update Options

Some notes:

  • The Updatable BAQ (uBAQ) is working

  • I can create new records using the Swagger API call. The API call works in Swagger and PostMan

  • The DataView appears to be dirty

  • Does this have something to do with the RowMod field?

The Rest call comes back as successful. But no new record is created.

Has anyone done this before? The issue has been isolated to Application Studio.

TL;DR

I am trying to create a record using the Rest Baq Service. The Rest call returns as successful but no new record generated.

I think its related to either

(A) The DataView is dirty (I think)

(B) It has something to with the RowMod.

Or I configured the Rest call incorrectly.

Regardless, any help would be much appreciated.

2 Likes

Take a look at the actual rest call to execute BAQ and look at the payload.

What do you mean by that? In the browser with developer options?

In the browser, it looks like its coming across as all empty fields?

Is this what you meant by look at the payload?

2 Likes

The correct fields/values are in the Payload.

Don’t see RowMod in there.

Does RowMod need to be set to U ?

It should probably exist at all, and should be A

1 Like

I just set this up and it worked for me.

Perhaps you should start over.

1 Like

I noticed in your pictures above, they both have the same control trigger.

Did you post the same picture twice, or is that a mistake?

Also, if you reuse that same row, instead of blowing it out and adding a new, you will need to use a row-update to set the RowMod to ‘A’

It exists, even if you can’t see it.

Could you show your setup? For example, the event workflow and rest params?

I appreciate this so much.

Temp Dataview: BVNewRow

Button Add New Record To Temp



BVNewRow_Get




Button Update





To clarify, the first time it will already be ‘A’ from the GetNew call, and will work, but subsequent calls will not because it will be reset from the Update call.

So either blow out the row, and add another, (which will blow out your data lol), or just use row-update to set the RowMod.

1 Like

@klincecum You rock! I got it working. Marked your post as the solution for internet points. :flexed_biceps:

1 Like

I Knew You Could GIF by MOODMAN

1 Like